control_status.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. //由于控制器指令共享同一个ID 0x20,建立此类维护控制指令的最新状态
  3. #include <common/boost.h>
  4. #include <cstdint>
  5. #include <boost/serialization/singleton.hpp>
  6. #include <control/vv7.h>
  7. namespace iv {
  8. namespace control {
  9. class ControlStatus : public boost::noncopyable
  10. {
  11. public:
  12. /*****************
  13. * ****测试标志位*****
  14. * ***************/
  15. int normal_speed = 0;//常规速度
  16. int swerve_speed = 0;//转弯速度
  17. int high_speed = 0;//快速
  18. int mid_speed = 0;//中速
  19. int low_speed = 0;//慢速
  20. int change_line = -1;//换道标志
  21. int stop_obstacle = -1;//停障标志
  22. int elude_obstacle = -1;//避障标志
  23. int special_signle = -1;//特殊信号标志
  24. int car_pullover = -1;//靠边停车标志位
  25. Command command;
  26. int command_ID = 0x12;
  27. void set_accelerate(float percent);
  28. void set_wheel_angle(float angle);
  29. void set_engine(char enable);
  30. void set_door(char enable);
  31. void set_speaker(bool enable);
  32. void set_flicker(bool enable);
  33. void set_light(bool enable);
  34. void set_turnsignals_control(bool left, bool right);
  35. };
  36. typedef boost::serialization::singleton<iv::control::ControlStatus> ControlStatusSingleton;
  37. }
  38. }
  39. #define ServiceControlStatus iv::control::ControlStatusSingleton::get_mutable_instance()