lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.27k stars 778 forks source link

How do I translate speed and acceleration into throttle and brake to control ego car? #280

Closed JIXIMD closed 4 years ago

JIXIMD commented 5 years ago

Hi, lg team Is there an API interface to support this transformation? If not, what should I do? Thank you for your help

daohu527 commented 5 years ago

What is the application scenario? There is currently no such API available. It seems that PID control can be used. If the speed is lower than expected, the throttle will be added. If it is higher than expected, the throttle will be reduced.

JIXIMD commented 5 years ago

yes, it is a PID control. I calculate my pid output, which is an acceleration compensation.But I don't know how to map it to the throttle and brake of the ego car

JIXIMD commented 5 years ago

Their mapping relationship is nonlinear, can you help to provide their mapping relationship

daohu527 commented 5 years ago

I don't know about this piece and see if others can help you.

cyberphysicalrobotics commented 5 years ago

LGSVL simulator gets throttle and brake command from Apollo control module. In apollo control module, there is control calibration table and other compensations by control options. You can refer this fact to the following files: /apollo/modules/control/conf/control_conf.pb.txt /apollo/modules/control/controller/lon_controller.cc