diff --git a/docs/leo-rover/documentation/ros-api.mdx b/docs/leo-rover/documentation/ros-api.mdx index 7bd92091..ad5e2804 100644 --- a/docs/leo-rover/documentation/ros-api.mdx +++ b/docs/leo-rover/documentation/ros-api.mdx @@ -26,6 +26,20 @@ image: /img/robots/leo/leo-rover-1.9.webp $[\frac{m}{s}]$ (if using the mecanum wheels mode) and `angular.z` $[\frac{rad}{s}]$ are used. +- `heading_controller/cmd_vel` ([geometry_msgs/msg/Twist]) + + Target velocity for the Rover when using heading control. Publish to this + topic instead of `cmd_vel` if you want the Rover to automatically correct its + steering and maintain its heading while driving straight or making wide turns. + Only `linear.x` $[\frac{m}{s}]$ and `angular.z` $[\frac{rad}{s}]$ are used. + This topic is not supported when using mecanum wheels. + + :::warning + + Cannot be used at the same time as other `cmd` topics. + + ::: + - `firmware/wheel_{FL,RL,FR,RR}/cmd_pwm_duty` ([std_msgs/msg/Float32]) Target PWM duty cycle for each wheel motor. $[\%]$ @@ -374,6 +388,30 @@ The parameters for `/firmware` node can be overridden by modifying the readings. The size of the array must be 3, representing the variances for the x, y and z axes. +#### /heading_controller + +- `linear_hold_deadband` (type: `float`, default: `0.05`) + + Minimum absolute `linear.x` command required to enable heading hold. If the + command is below this value, no heading correction is applied. + +- `kp` (type: `float`, default: `15.0`) + + Proportional gain used to convert heading error into `angular.z` correction. + +- `max_correction` (type: `float`, default: `1.0`) + + Maximum absolute `angular.z` correction allowed by the heading controller. + +- `yaw_deadband` (type: `float`, default: `0.005`) + + Heading error tolerance. Errors within this range produce no correction. + +- `angular_hold_deadband` (type: `float`, default: `0.2`) + + Maximum absolute `angular.z` command still treated as heading-hold mode. Above + this value, no heading correction is applied. + #### /imu_filter - `gain_acc` (type: `float`, default: `0.01`) diff --git a/docs/leo-rover/documentation/specification.mdx b/docs/leo-rover/documentation/specification.mdx index 5571cda3..8cc23d31 100644 --- a/docs/leo-rover/documentation/specification.mdx +++ b/docs/leo-rover/documentation/specification.mdx @@ -486,6 +486,13 @@ There are two important software components that don't run as native ROS nodes: to communicate with ROS nodes. + + Heading controller + + Node that filters the movement commands sent to the robot to maintain a desired heading when driving straight or during + wide turns. This helps the robot to better maintain its course, especially if the rubber wheels are slightly deformed. + + @@ -538,7 +545,7 @@ This is a user interface that can be accessed via a web browser. It communicates with the Rosbridge server using [roslibjs] to access features available on ROS topics. The default [leo_ui] provides features such as: -- control of the rover via a keyboard or a virtual joystick, +- control of the rover via a keyboard, gamepad or a virtual joystick, - display of a camera stream from the Web video server, with the ability to select the source ROS topic for the video stream, - display of the current battery voltage measurement,