ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.12k stars 9.7k forks source link

How to get started with control and debuding control module of apollo 3.5.0? #10910

Closed Addi2020 closed 4 years ago

Addi2020 commented 4 years ago

I am new to Github and Apollo. I want to start working on control module. I finished setup the dream view environment. Can i use the recorded files to start working on control?

alexiskovi commented 4 years ago

It depends of what do you mean by working on control. You can see debug values by playing bag: cyber_recorder play -f <path to bags> and watching /apollo/control channel in cyber_monitor. There are a lot of variables, so you can navigate between pages by Page Up/Page Down. But bags only is not enough to try your own algorithms, try to use simulators, like LGSVL

daohu527 commented 4 years ago

You can treat “control module” as a function, then enter the set value and check the output value.

Input

  1. Chassis
  2. ADCTrajectory
  3. LocalizationEstimate

Output

  1. ControlCommand(throttle, brake, steering_rate)

Todo

In fact, the output of the throttle, brake and steering wheel angle will control the state of the car, and then the control module will perform calculations based on the current state of the car again. Because you don't have a real car to simulate the model. You can write a function to simulate the dynamic model of the car, and then feedback the state of the car, this may be a feasible way.

|--->car state ----> control algorithm -------Control cmd-->| |<-------------------Car dynamics model <-----------------------|

The easy way is to use a simulator to simulate the car dynamics model.

Addi2020 commented 4 years ago

thanks for reply. Actually i have a recording file that i use in dream view environment and launch control module, the log file shows some errors..

Log file created at: 2020/04/02 09:06:59 Running on machine: in_dev_docker Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg I0402 09:06:59.645385 8457 class_loader_utility.h:78] registerclass:ControlComponent,apollo::cyber::ComponentBase,/apollo/bazel-bin/modules/control/libcontrol_component.so I0402 09:06:59.678946 8457 control_component.cc:42] Control init, starting ... I0402 09:06:59.716745 8457 control_component.cc:48] Conf file: /apollo/modules/control/conf/control_conf.pb.txt is loaded. I0402 09:06:59.716774 8457 control_component.cc:50] Conf file: is loaded. I0402 09:06:59.716778 8457 controller_agent.cc:36] Only support MPC controller or Lat + Lon controllers as of now I0402 09:06:59.717275 8457 lat_controller.cc:86] Using LQR-based Lateral Controller I0402 09:06:59.720041 8457 lat_controller.cc:260] Lateral control gain scheduler loaded I0402 09:06:59.722167 8457 lat_controller.cc:159] LQR-based Lateral Controller begin. I0402 09:06:59.722185 8457 latcontroller.cc:160] [LatController parameters] mass: 2080, iz: 4208.3, lf: 1.4224, lr_: 1.4224 I0402 09:06:59.722234 8457 controller_agent.cc:92] Controller init done! I0402 09:06:59.722259 8457 lon_controller.cc:140] Control calibration table loaded I0402 09:06:59.722270 8457 lon_controller.cc:141] Control calibration table size is 1297 I0402 09:06:59.723677 8457 controller_agent.cc:92] Controller init done! I0402 09:06:59.756345 8457 control_component.cc:98] Control resetting vehicle state, sleeping for 1000 ms ... I0402 09:07:00.756469 8457 control_component.cc:104] Control default driving action is STOP I0402 09:07:00.770310 8465 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:01.767935 8469 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:02.790998 8472 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:03.781472 8469 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:04.770012 8467 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:05.766600 8463 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:06.768800 8474 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:07.829711 8470 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:08.767802 8466 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:09.770442 8461 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:10.767359 8474 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:11.768520 8468 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:12.776490 8468 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:13.774690 8470 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:14.770660 8470 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:15.771960 8462 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:16.779045 8466 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:17.766705 8460 control_component.cc:216] Reset Controllers in Manual Mode I0402 09:07:19.249977 8471 control_component.cc:216] Reset Controllers in Manual Mode W0402 09:07:19.652999 8465 control_component.cc:365] planning has no trajectory point. E0402 09:07:19.653034 8465 control_component.cc:168] Control input data failed: planning has no trajectory point. planning_seq_num:811 W0402 09:07:19.653085 8465 control_component.cc:207] planning has no trajectory point. W0402 09:07:19.653182 8465 control_component.cc:256] Estop triggered! No control core method executed! E0402 09:07:19.653192 8465 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.653884 8464 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.654876 8471 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.655954 8466 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.657271 8467 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.659201 8472 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.659972 8466 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.660898 8472 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.661955 8469 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.663019 8471 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.663872 8469 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.664870 8466 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811 E0402 09:07:19.665850 8467 control_component.cc:315] Failed to produce control command:planning has no trajectory point. planning_seq_num:811

daohu527 commented 4 years ago

Can be seen from the log, planning trajectory is misssing, you should check the topic "/apollo/planning" is exist.

W0402 09:07:19.652999 8465 control_component.cc:365] planning has no trajectory point.
Addi2020 commented 4 years ago

yes, i check the topic using cyber_monitor . the topic exist /apollo/canbus/chassis
/apollo/control /apollo/localization/pose /apollo/planning
/apollo/prediction Screenshot from 2020-04-02 16-06-00

daohu527 commented 4 years ago

@Addi2020 You should check into the channel "/apollo/planning" in cyber monitor, then check if the data (trajectory_point) in planning message is empty.
Maybe there is an empty message.

Addi2020 commented 4 years ago

yeah, thanks, I check inside apollo/planning and check log , I think the recording file that i am using have problem. because of PLANNING_ERROR: Found collision with obstacle: 23667.

how can we debug controller (steer, break, throttle), without having recording data? and check the controller performance that everything is well then test practical vehicle.

Planning Log...

Log file created at: 2020/04/02 15:02:43 Running on machine: in_dev_docker Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg I0402 15:02:43.465723 20382 class_loader_utility.h:78] registerclass:PlanningComponent,apollo::cyber::ComponentBase,/apollo/bazel-bin/modules/planning/libplanning_component.so E0402 15:02:43.479475 20382 planning_component.cc:41] NaviPlanning create I0402 15:02:43.483659 20382 navi_planner.cc:80] In NaviPlanner::Init() I0402 15:02:43.483726 20382 navi_planner.cc:87] Created task:NaviPathDecider I0402 15:02:43.483754 20382 navi_planner.cc:87] Created task:NaviSpeedDecider I0402 15:02:43.483780 20382 navi_path_decider.cc:61] Maximum speeds and move to dest lane config: I0402 15:02:43.483793 20382 navi_path_decider.cc:65] [max_speed : 34 ,max move dest lane shift y : 0.45] E0402 15:02:43.565065 20382 planning_component.cc:100] planning conponet init ok W0402 15:02:57.650107 20385 channel_buffer.h:70] channel[/apollo/relative_map] read buffer overflow, drop_message[1] pre_index[160] current_index[161] W0402 15:02:59.350848 20392 channel_buffer.h:70] channel[/apollo/relative_map] read buffer overflow, drop_message[1] pre_index[194] current_index[195] W0402 15:03:03.075150 20389 navi_planner.cc:284] last frame is empty I0402 15:03:03.076845 20389 navi_speed_decider.cc:388] obstacle with id: 22579 s: 10.4419 distance: 5.55192 speed: 0 safe_distance: 14.89 I0402 15:03:03.076941 20389 navi_speed_decider.cc:388] obstacle with id: 22002 s: 12.3449 distance: 7.45488 speed: 0 safe_distance: 14.89 I0402 15:03:03.076995 20389 navi_speed_decider.cc:388] obstacle with id: 21858 s: 12.1772 distance: 7.28718 speed: 0 safe_distance: 14.89 I0402 15:03:03.077046 20389 navi_speed_decider.cc:388] obstacle with id: 22416 s: 14.2069 distance: 9.31695 speed: 0 safe_distance: 14.89 I0402 15:03:03.077097 20389 navi_speed_decider.cc:388] obstacle with id: 22062 s: 25.5622 distance: 20.6722 speed: 0 safe_distance: 14.89 I0402 15:03:03.077148 20389 navi_speed_decider.cc:388] obstacle with id: 22582 s: 13.7036 distance: 8.8136 speed: 0 safe_distance: 14.89 I0402 15:03:03.077199 20389 navi_speed_decider.cc:388] obstacle with id: 22214 s: 12.6546 distance: 7.76458 speed: 0 safe_distance: 14.89 I0402 15:03:03.077250 20389 navi_speed_decider.cc:388] obstacle with id: 22421 s: 0.970486 distance: 0 speed: 0 safe_distance: 14.89 I0402 15:03:03.077313 20389 navi_speed_decider.cc:388] obstacle with id: 22386 s: 9.31916 distance: 4.42916 speed: 0 safe_distance: 14.89 I0402 15:03:03.077361 20389 navi_speed_decider.cc:388] obstacle with id: 22483 s: 10.7334 distance: 5.84341 speed: 0 safe_distance: 14.89 I0402 15:03:03.077410 20389 navi_speed_decider.cc:388] obstacle with id: 22501 s: 15.7622 distance: 10.8722 speed: 0 safe_distance: 14.89 I0402 15:03:03.077466 20389 navi_speed_decider.cc:388] obstacle with id: 22375 s: 9.25865 distance: 4.36865 speed: 0 safe_distance: 14.89 I0402 15:03:03.077517 20389 navi_speed_decider.cc:388] obstacle with id: 22569 s: 13.6268 distance: 8.73682 speed: 0 safe_distance: 14.89 I0402 15:03:03.077638 20389 navi_speed_decider.cc:489] add speed limit for centric acceleration with kappa: 0 v_max: 1.79769e+308 v_preffered: 1.79769e+308 s: 0 W0402 15:03:03.081015 20389 channel_buffer.h:70] channel[/apollo/prediction] read buffer overflow, drop_message[73] pre_index[2] current_index[75] E0402 15:03:03.093806 20389 frame.cc:368] Found collision with obstacle: 23667 E0402 15:03:03.094365 20389 frame.cc:329] failed to init frame:PLANNING_ERROR: Found collision with obstacle: 23667 E0402 15:03:03.094552 20389 navi_planning.cc:121] failed to init frame:PLANNING_ERROR: Found collision with obstacle: 23667 E0402 15:03:03.094655 20389 navi_planning.cc:244] PLANNING_ERROR: Found collision with obstacle: 23667 I0402 15:03:03.175187 20398 navi_speed_decider.cc:388] obstacle with id: 23535 s: -0.179952 distance: 0 speed: 0 safe_distance: 14.89 I0402 15:03:03.175266 20398 navi_speed_decider.cc:388] obstacle with id: 23712 s: 10.8765 distance: 5.98653 speed: 0 safe_distance: 14.89 I0402 15:03:03.175323 20398 navi_speed_decider.cc:388] obstacle with id: 23581 s: 7.70454 distance: 2.81454 speed: 0 safe_distance: 14.89 I0402 15:03:03.175367 20398 navi_speed_decider.cc:388] obstacle with id: 23146 s: 25.7206 distance: 20.8306 speed: 0 safe_distance: 14.89 I0402 15:03:03.175428 20398 navi_speed_decider.cc:388] obstacle with id: 23652 s: 61.4078 distance: 56.5178 speed: 0 safe_distance: 14.89 I0402 15:03:03.175818 20398 navi_speed_decider.cc:489] add speed limit for centric acceleration with kappa: 0 v_max: 1.79769e+308 v_preffered: 1.79769e+308 s: 0 I0402 15:03:03.315753 20390 navi_speed_decider.cc:388] obstacle with id: 23855 s: 19.4515 distance: 14.5615 speed: 0 safe_distance: 14.89 I0402 15:03:03.315846 20390 navi_speed_decider.cc:388] obstacle with id: 23146 s: 25.3365 distance: 20.4465 speed: 0 safe_distance: 14.89 I0402 15:03:03.315904 20390 navi_speed_decider.cc:388] obstacle with id: 23581 s: 7.58869 distance: 2.69869 speed: 0 safe_distance: 14.89 I0402 15:03:03.315960 20390 navi_speed_decider.cc:388] obstacle with id: 23652 s: 60.6108 distance: 55.7208 speed: 0 safe_distance: 14.89 I0402 15:03:03.316015 20390 navi_speed_decider.cc:388] obstacle with id: 23712 s: 9.36705 distance: 4.47705 speed: 0 safe_distance: 14.89 I0402 15:03:03.316932 20390 navi_speed_decider.cc:489] add speed limit for centric acceleration with kappa: 0 v_max: 1.79769e+308 v_preffered: 1.79769e+308 s: 0 I0402 15:03:03.394937 20396 navi_speed_decider.cc:388] obstacle with id: 23806 s: 27.0025 distance: 22.1125 speed: 0 safe_distance: 14.89 I0402 15:03:03.395026 20396 navi_speed_decider.cc:388] obstacle with id: 23146 s: 24.8413 distance: 19.9513 speed: 0 safe_distance: 14.89 I0402 15:03:03.395079 20396 navi_speed_decider.cc:388] obstacle with id: 23643 s: 2.53396 distance: 0 speed: 0 safe_distance: 14.89 I0402 15:03:03.395129 20396 navi_speed_decider.cc:388] obstacle with id: 23523 s: 3.05421 distance: 0 speed: 0 safe_distance: 14.89 I0402 15:03:03.395179 20396 navi_speed_decider.cc:388] obstacle with id: 23581 s: 10.1238 distance: 5.23375 speed: 0 safe_distance: 14.89 I0402 15:03:03.395231 20396 navi_speed_decider.cc:388] obstacle with id: 23652 s: 59.6572 distance: 54.7672 speed: 0 safe_distance: 14.89 I0402 15:03:03.395319 20396 navi_speed_decider.cc:388] obstacle with id: 23712 s: 9.62105 distance: 4.73105 speed: 0 safe_distance: 14.89 I0402 15:03:03.395471 20396 navi_speed_decider.cc:489] add speed limit for centric acceleration with kappa: 0 v_max: 1.79769e+308 v_preffered: 1.79769e+308 s: 0 I0402 15:03:03.473757 20385 navi_speed_decider.cc:388] obstacle with id: 23581 s: 6.75095 distance: 1.86095 speed: 0 safe_distance: 14.89 I0402 15:03:03.473839 20385 navi_speed_decider.cc:388] obstacle with id: 23065 s: 3.0901 distance: 0 speed: 0 safe_distance: 14.89 I0402 15:03:03.473901 20385 navi_speed_decider.cc:388] obstacle with id: 23146 s: 24.4345 distance: 19.5445 speed: 0 safe_distance: 14.89