controller.cpp 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #include <control/controller.h>
  2. iv::control::Controller::Controller() {
  3. }
  4. iv::control::Controller::~Controller() {
  5. }
  6. void iv::control::Controller::inialize() {
  7. }
  8. //校验和
  9. void iv::control::Controller::cmd_checksum(unsigned char cmd_id) {
  10. ServiceControlStatus.set_cmd_checksum(cmd_id);
  11. }
  12. //方向盘控制
  13. void iv::control::Controller::control_wheel(float angle) {
  14. ServiceControlStatus.set_wheel_angle(angle);
  15. }
  16. void iv::control::Controller:: control_angle_speed(float angSpeed){
  17. ServiceControlStatus.set_wheel_speed(angSpeed);
  18. }
  19. void iv::control::Controller:: control_angle_enable(bool enable){
  20. ServiceControlStatus.set_wheel_enable(enable);
  21. }
  22. //速度限制
  23. void iv::control::Controller:: control_speed_limit(float speedLimit){
  24. ServiceControlStatus.set_speed_limit(speedLimit);
  25. }
  26. //油门控制
  27. void iv::control::Controller::control_torque(float percent){
  28. ServiceControlStatus.set_torque(percent);
  29. }
  30. void iv::control::Controller::control_acc_en(bool enanble){
  31. ServiceControlStatus.set_acc_enable(enanble);
  32. }
  33. void iv::control::Controller::control_aeb(float aeb){
  34. ServiceControlStatus.set_aeb(aeb);
  35. }
  36. void iv::control::Controller::control_aeb_en(bool enable){
  37. ServiceControlStatus.set_aeb_enable(enable);
  38. }
  39. //刹车控制
  40. void iv::control::Controller::control_brake(float brake){
  41. ServiceControlStatus.set_brake(brake);
  42. }
  43. //档位控制
  44. void iv::control::Controller::control_gear(float gear){
  45. ServiceControlStatus.set_gear(gear);
  46. }
  47. void iv::control::Controller::control_gear_en(bool enable){
  48. ServiceControlStatus.set_gear_enable(enable);
  49. }
  50. //手刹
  51. void iv::control::Controller::control_handBrake(bool enable){
  52. ServiceControlStatus.set_handBrake(enable);
  53. }
  54. //驾驶模式
  55. void iv::control::Controller::control_mode(char mode){
  56. ServiceControlStatus.set_driveMode(mode);
  57. }
  58. //车窗控制
  59. //void iv::control::Controller::control_win_lf(char para){
  60. // ServiceControlStatus.set_win_lf(para);
  61. //}
  62. //void iv::control::Controller::control_win_rf(char para){
  63. // ServiceControlStatus.set_win_rf(para);
  64. //}
  65. //void iv::control::Controller::control_win_lr(char para){
  66. // ServiceControlStatus.set_win_lr(para);
  67. //}
  68. //void iv::control::Controller::control_win_rr(char para){
  69. // ServiceControlStatus.set_win_rr(para);
  70. //}
  71. //空调控制
  72. void iv::control::Controller::control_air_on(bool enable){
  73. if(enable){
  74. ServiceControlStatus.set_air_on(1);
  75. }else{
  76. ServiceControlStatus.set_air_on(0);
  77. }
  78. }
  79. //void iv::control::Controller::control_air_cricle(char para){
  80. // ServiceControlStatus.set_air_cricle(para);
  81. //}
  82. //void iv::control::Controller::control_air_auto(char para){
  83. // ServiceControlStatus.set_air_auto(para);
  84. //}
  85. //void iv::control::Controller::control_air_off(char para){
  86. // ServiceControlStatus.set_air_off(para);
  87. //}
  88. //void iv::control::Controller::control_air_temup(char para){
  89. // ServiceControlStatus.set_air_temup(para);
  90. //}
  91. //void iv::control::Controller::control_air_temdown(char para){
  92. // ServiceControlStatus.set_air_temdown(para);
  93. //}
  94. //void iv::control::Controller::control_air_powerup(char para){
  95. // ServiceControlStatus.set_air_powerup(para);
  96. //}
  97. //void iv::control::Controller::control_air_powerdown(char para){
  98. // ServiceControlStatus.set_air_powerdown(para);
  99. //}
  100. //点火控制
  101. void iv::control::Controller::control_obligate(char para){
  102. ServiceControlStatus.set_obligate(para);
  103. }
  104. //车门控制
  105. void iv::control::Controller::control_door(char enable){
  106. ServiceControlStatus.set_door(enable);
  107. }
  108. //车灯控制
  109. void iv::control::Controller::control_turnsignals(bool left, bool right){
  110. ServiceControlStatus.set_turnsignals_control(left,right);
  111. }
  112. void iv::control::Controller::control_small_light(char para){
  113. ServiceControlStatus.set_small_light(para);
  114. }
  115. void iv::control::Controller::control_near_light(char para){
  116. ServiceControlStatus.set_near_light(para);
  117. }
  118. void iv::control::Controller::control_far_light(char para){
  119. ServiceControlStatus.set_far_light(para);
  120. }
  121. void iv::control::Controller::control_frog_light(char para){
  122. ServiceControlStatus.set_frog_light(para);
  123. }
  124. void iv::control::Controller::control_brake_light(char para){
  125. ServiceControlStatus.set_brake_light(para);
  126. }
  127. void iv::control::Controller::control_defrog(char para){
  128. ServiceControlStatus.set_defrog(para);
  129. }
  130. void iv::control::Controller::control_reverse_light(char para){
  131. ServiceControlStatus.set_reverse_light(para);
  132. }
  133. //喇叭控制
  134. void iv::control::Controller::control_horn(char para){
  135. ServiceControlStatus.set_horn(para);
  136. }
  137. //雨刷控制
  138. void iv::control::Controller::control_wiper(char para){
  139. ServiceControlStatus.set_wiper(para);
  140. }
  141. void iv::control::Controller::control_air_temp(char para){
  142. ServiceControlStatus.set_air_temp(para);
  143. }
  144. void iv::control::Controller::control_air_mode(char para){
  145. ServiceControlStatus.set_air_mode(para);
  146. }
  147. void iv::control::Controller::control_air_enable(bool enable){
  148. ServiceControlStatus.set_air_enable(enable);
  149. }
  150. void iv::control::Controller::control_wind_level(char para){
  151. ServiceControlStatus.set_wind_level(para);
  152. }
  153. void iv::control::Controller::control_roof_light(char para){
  154. ServiceControlStatus.set_roof_light(para);
  155. }
  156. void iv::control::Controller::control_home_light(char para){
  157. ServiceControlStatus.set_home_light(para);
  158. }
  159. void iv::control::Controller::control_air_worktime(char para){
  160. ServiceControlStatus.set_air_worktime(para);
  161. }
  162. void iv::control::Controller::control_air_offtime(char para){
  163. ServiceControlStatus.set_air_offtime(para);
  164. }
  165. //void iv::control::Controller::control_flicker(bool enable){
  166. // ServiceControlStatus.set_flicker(enable);
  167. //}
  168. //void iv::control::Controller::control_braking(float percent){
  169. //}