mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
saved work
This commit is contained in:
@@ -25,54 +25,54 @@ int main(int argc, char **argv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ScoutRobot scout(AgilexProtocol::V1);
|
||||
// scout.Connect(device_name);
|
||||
ScoutRobot scout(ProtocolType::AGX_V2);
|
||||
// scout.Connect(device_name);
|
||||
|
||||
// scout.EnableCommandedMode();
|
||||
// scout.EnableCommandedMode();
|
||||
|
||||
// // // light control
|
||||
// std::cout << "Light: const off" << std::endl;
|
||||
// scout.SetLightCommand({CONST_OFF, 0, CONST_OFF, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: const on" << std::endl;
|
||||
// scout.SetLightCommand({CONST_ON, 0, CONST_ON, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: breath" << std::endl;
|
||||
// scout.SetLightCommand({BREATH, 0, BREATH, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: custom 90-80" << std::endl;
|
||||
// scout.SetLightCommand({CUSTOM, 90, CUSTOM, 80});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: diabled cmd control" << std::endl;
|
||||
// scout.DisableLightControl();
|
||||
// // // light control
|
||||
// std::cout << "Light: const off" << std::endl;
|
||||
// scout.SetLightCommand({CONST_OFF, 0, CONST_OFF, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: const on" << std::endl;
|
||||
// scout.SetLightCommand({CONST_ON, 0, CONST_ON, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: breath" << std::endl;
|
||||
// scout.SetLightCommand({BREATH, 0, BREATH, 0});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: custom 90-80" << std::endl;
|
||||
// scout.SetLightCommand({CUSTOM, 90, CUSTOM, 80});
|
||||
// sleep(3);
|
||||
// std::cout << "Light: diabled cmd control" << std::endl;
|
||||
// scout.DisableLightControl();
|
||||
|
||||
// int count = 0;
|
||||
// while (true) {
|
||||
// // motion control
|
||||
// if (count < 100) {
|
||||
// std::cout << "Motor: 0.2, 0" << std::endl;
|
||||
// scout.SetMotionCommand(0.2, 0.0);
|
||||
// }
|
||||
// int count = 0;
|
||||
// while (true) {
|
||||
// // motion control
|
||||
// if (count < 100) {
|
||||
// std::cout << "Motor: 0.2, 0" << std::endl;
|
||||
// scout.SetMotionCommand(0.2, 0.0);
|
||||
// }
|
||||
|
||||
// // get robot state
|
||||
// auto state = scout.GetScoutState();
|
||||
// std::cout << "-------------------------------" << std::endl;
|
||||
// std::cout << "count: " << count << std::endl;
|
||||
// std::cout << "control mode: "
|
||||
// << static_cast<int>(state.system_state.control_mode)
|
||||
// << " , vehicle state: "
|
||||
// << static_cast<int>(state.system_state.vehicle_state)
|
||||
// << std::endl;
|
||||
// std::cout << "battery voltage: " << state.system_state.battery_voltage
|
||||
// << std::endl;
|
||||
// std::cout << "velocity (linear, angular): "
|
||||
// << state.motion_state.linear_velocity << ", "
|
||||
// << state.motion_state.angular_velocity << std::endl;
|
||||
// std::cout << "-------------------------------" << std::endl;
|
||||
// // get robot state
|
||||
// auto state = scout.GetScoutState();
|
||||
// std::cout << "-------------------------------" << std::endl;
|
||||
// std::cout << "count: " << count << std::endl;
|
||||
// std::cout << "control mode: "
|
||||
// << static_cast<int>(state.system_state.control_mode)
|
||||
// << " , vehicle state: "
|
||||
// << static_cast<int>(state.system_state.vehicle_state)
|
||||
// << std::endl;
|
||||
// std::cout << "battery voltage: " << state.system_state.battery_voltage
|
||||
// << std::endl;
|
||||
// std::cout << "velocity (linear, angular): "
|
||||
// << state.motion_state.linear_velocity << ", "
|
||||
// << state.motion_state.angular_velocity << std::endl;
|
||||
// std::cout << "-------------------------------" << std::endl;
|
||||
|
||||
// usleep(20000);
|
||||
// ++count;
|
||||
// }
|
||||
// usleep(20000);
|
||||
// ++count;
|
||||
// }
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user