gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
685 stars 262 forks source link

[Proposal] Drive to point/configuration controller plugin for wheeled vehicles #2379

Open sauk2 opened 5 months ago

sauk2 commented 5 months ago

Desired behavior

Currently, Gazebo provides plugins for wheeled vehicles/robots (DiffDrive, AckermannSteering) that work using /cmd_vel and can be integrated with velocity-based controllers (VelocityControl) for precise movement. However, this may not always work for use cases requiring movement to a specific position on the global map. A position controller plugin for wheeled vehicles would address this gap, making it convenient to simulate point-to-point movement without the need to write external controllers or use other packages.

Alternatives considered

Implementation suggestion

Control problem

Note: The implementation follows the ideas outlined in Chapter 4 (pp. 130-141) of Corke et. al.[1]

The vehicle uses a bicycle model to describe its behaviour.

image Figure 1: Bicycle model of a wheeled vehicle [1]

The following equations describe the control of a vehicle moving towards a goal $(x^{*}, y^{*})$ from its current position $(x, y)$

The linear error is minimised using the following equation,

$$v^{*} = K_v \sqrt{ (x^{*} - x)^2 + (y^{*} - y)^2 }$$

Angular error (in radians) is minimised using the following equations. The result should lie in the interval $[-\pi, \pi)$

$$\theta^{*} = atan2 \left( \frac{y^{*} - y}{x^{*} - x} \right)$$

$$\psi = K_h ( \theta^{*} - \theta )$$

Plugin structure

Additional context

Result

Implementation of a simple 'drive to point' controller tested on the model used in the DiffDrive example.

https://github.com/gazebosim/gz-sim/assets/75178156/83d0afc1-1a45-45d4-a9a7-c9b77e28fd53

References

[1] Corke, P., Jachimczyk, W., Pillat, R. (2023). Mobile Robot Vehicles. In: Robotics, Vision and Control. Springer Tracts in Advanced Robotics, vol 147. Springer, Cham. https://doi.org/10.1007/978-3-031-07262-8_4

azeey commented 4 months ago

@sauk2 are you interested in implementing this yourself?

sauk2 commented 4 months ago

@sauk2 are you interested in implementing this yourself?

@azeey Yes, I can work on this implementation.

azeey commented 3 months ago

Thanks! I've assigned it to you.