Skip to content

Support velocity commands

Natsu Ozawa requested to merge support-velocity-commands into ros2

Closes #24 (closed)

This MR adds support for velocity commands in the vehicle model.

To see this in action, select "Speed" in the dropdown menu in the EUFS Robot Steering GUI.

The new code works by converting the speed input to an appropriate acceleration value before the car consumes the input.

First, an ideal appropriate acceleration value is set so that the car accelerates immediately to the desired speed in one iteration. At every iteration, the program calculates the ideal acceleration by dividing the difference between the target speed (provided by the input) and the current speed (calculated from the x and y twists) by the time it takes to undergo one iteration (dt). Then, one of the following happens.

  • The ideal acceleration is less than the maximum acceleration. Therefore, the car accelerates to the target speed in one iteration.
  • The ideal acceleration is larger than the maximum acceleration. After one iteration, the difference between the target speed and the current speed is smaller. The car will reach the desired speed in several iterations. After the car has reach the desired speed, the ideal acceleration approximates to 0. Note that the car does not reach the exact target speed because there is a variation in dt.

This MR introduces new fields to the input ranges parameter, which is used in two config files.

The changes have been tested manually (using the Manual Mission). The car accelerates and decelerates in a very short amount of time.

Reviewing this MR should not be urgent.

Merge request reports