Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differential Drive Documentation #3133

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Differential Drive Documentation #3133

wants to merge 3 commits into from

Conversation

PerFrivik
Copy link
Contributor

Documentation for the Rover Differential Drive module in PX4.

This documentation needs to wait for one or two PX4 PR's before we can merge this documentation, as it is based on some changes that I want to implement based on user feedback (PX4/PX4-Autopilot#22877).

@PerFrivik PerFrivik self-assigned this Mar 25, 2024
@PerFrivik
Copy link
Contributor Author

Oops, thank you GitHub Actions Bot 👍


In manual mode, the left and right joystick/stick inputs directly control (open-loop) the rover's forward speed and yaw rate (rotation rate), respectively. The rover does not attempt to maintain a specific position or heading but instead responds directly to the user's inputs, without any closed-loop feedback control.

![Rover Manual Sticks](../../assets/flight_modes/manual_differential_rover_new.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diagram looks great. What did you use to generate it? What I normally do is use online software and share the link to the editable version as an HTML comment below or sometimes I ALSO export an SVG file - since that makes editing easier.

@hamishwillee
Copy link
Collaborator

All obey the bot.

Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great push, nice drawings, good content!

@@ -0,0 +1,83 @@
# Differential Drive Rover Configuration & Tuning

This is the configuration document for a [Differential Drive Rover](../airframes/airframe_reference.md#rover_rover_aion_robotics_r1_ugv), this rover type is very similar to also known as "Tank Drive & Skid Steer". This type of rover control type is essentially what you would find in a modern robot vacuum cleaner, also known as a "Roomba".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is the configuration document for a [Differential Drive Rover](../airframes/airframe_reference.md#rover_rover_aion_robotics_r1_ugv), this rover type is very similar to also known as "Tank Drive & Skid Steer". This type of rover control type is essentially what you would find in a modern robot vacuum cleaner, also known as a "Roomba".
This is the configuration document for a [Differential Drive Rover](../airframes/airframe_reference.md#rover_rover_aion_robotics_r1_ugv). The actuation principle of this rover type is also known as "tank drive" or "skid steer", and is for example common for indoor vacuum cleaner.


- `RDD_MAX_JERK`: This parameter limits the rate of change of acceleration/deceleration, resulting in smoother motion profiles and reducing the risk of sudden jerks or oscillations.

- `RDD_MAX_ACCEL`: This parameter sets the maximum acceleration (in meters per second squared) for the rover, limiting the rate at which the rover can increase or decrease its speed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would either use the unit for all params or leave it away here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And those params don't seem to exist, or at least the bot isn't finding them


- `RDD_MAX_ACCEL`: This parameter sets the maximum acceleration (in meters per second squared) for the rover, limiting the rate at which the rover can increase or decrease its speed.

Proper configuration of these parameters is essential for achieving the desired performance and stability of the Differential Drive Rover. The geometric parameters define the rover's physical characteristics, while the speed parameters control the maximum attainable velocities. The control gains dictate the responsiveness and accuracy of the control system, and the motion constraints ensure smooth and safe operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Proper configuration of these parameters is essential for achieving the desired performance and stability of the Differential Drive Rover. The geometric parameters define the rover's physical characteristics, while the speed parameters control the maximum attainable velocities. The control gains dictate the responsiveness and accuracy of the control system, and the motion constraints ensure smooth and safe operation.
Proper configuration of these parameters is essential for achieving the desired performance and stability of rover drive control. The geometric parameters define the rover's physical characteristics, while the speed parameters control the maximum attainable velocities. The control gains dictate the responsiveness and accuracy of the control system, and the motion constraints ensure smooth and safe operation.


- `speed` (float32): Collective roll-off speed in body x-axis [m/s]
- `closed_loop_speed_control` (bool): True if speed is controlled using estimator feedback, false if direct feed-forward
- `yaw_rate` (float32): Yaw rate [rad/s]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we generally should use "turning rate" instead of "yaw rate" for rovers? How is it done in literature that you found?
As generally it's pretty clear around which axis you turn a rover, and not all rover operators may be familiar with Euler angles.

- `yaw_rate` (float32): Yaw rate [rad/s]
- `closed_loop_yaw_rate_control` (bool): True if yaw rate is controlled using gyroscope feedback, false if direct feed-forward

Regardless of the source (manual, mission, or ROS2), the setpoints (`v, ω, flags`) are sent through the `DifferentialDriveSetpoint` message to the PI controllers. The controlled setpoints (`v', ω'`) are then passed to the inverse kinematics module, which calculates the wheel angular velocities (`θl, θr`) for the left and right wheels, respectively. These wheel angular velocities are used to control the left and right motors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Regardless of the source (manual, mission, or ROS2), the setpoints (`v, ω, flags`) are sent through the `DifferentialDriveSetpoint` message to the PI controllers. The controlled setpoints (`v', ω'`) are then passed to the inverse kinematics module, which calculates the wheel angular velocities (`θl, θr`) for the left and right wheels, respectively. These wheel angular velocities are used to control the left and right motors.
Regardless of the source (manual, mission, or ROS2), the setpoints (`v, ω, flags`) are sent through the `DifferentialDriveSetpoint` message to the PI (Proportional- Integral) controller. The controlled setpoints (`v', ω'`) are then passed to the inverse kinematics module, which calculates the wheel angular velocities (`θl, θr`) for the left and right wheels, respectively. These wheel angular velocities are used to control the left and right motors.

| Parameter | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| <a id="RRD_SPEED_SCALE"></a>[RRD_SPEED_SCALE](../advanced_config/parameter_reference.md#RRD_SPEED_SCALE) | Scales the speed output of the rover by multiplying it with this parameter to adjust for too high manual open-loop speeds. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this param description is a bit rough, at least I don't fully get it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all docs in guides, assume your user knows very little indeed and adjust your terminology appropriately.

Also applies to diagrams - for example, if you use a symbol, define it. You can't assume they will assume "v" is velocity or whatever.

For this case I don't know what an open-loop speed is. What are the symptoms? How do you tune it? (You might have explained this elsewhere.

- This mode requires a global 3d position estimate (from GPS or inferred from a [local position](../ros/external_position_estimation.md#enabling-auto-modes-with-a-local-position)).
- The vehicle must be armed before this mode can be engaged.
- This mode is automatic - no user intervention is _required_ to control the vehicle.
- RC control switches can be used to change flight modes on any vehicle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this comment is necessary. You can also change the mode through a mavlink command e.g.

## Description

Missions are usually created in a ground control station (e.g. [QGroundControl](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/plan_view/plan_view.html)) and uploaded prior to launch.
They may also be created by a developer API, and/or uploaded in flight.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
They may also be created by a developer API, and/or uploaded in flight.
They may also be created by a developer API, and can be updated when armed (the vehicle will have to switch out of Mission mode though).


PX4 expects to follow a straight line from the previous waypoint to the current target (it does not plan any other kind of path between waypoints - if you need one you can simulate this by adding additional waypoints).

An Ackermann Rover will follow a smooth rounded curve towards the next waypoint (if one is defined) defined by the acceptance radius ([NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An Ackermann Rover will follow a smooth rounded curve towards the next waypoint (if one is defined) defined by the acceptance radius ([NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD)).
An Ackermann rover will follow a smooth rounded curve towards the next waypoint (if one is defined) defined by the acceptance radius ([NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD)).


Vehicles switch to the next waypoint as soon as they enter the acceptance radius ([NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD)).

## Differential Rover: Stop, Turn, Drive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you already highlight it before in the Ackermann section, also say here whether the rover tracks the path between two waypoints or goes always directly to the waypoint.

@sfuhrer sfuhrer marked this pull request as ready for review March 27, 2024 17:47
@sfuhrer sfuhrer marked this pull request as draft March 27, 2024 17:47
@hamishwillee
Copy link
Collaborator

Note, I have only fly-by looked at this. I'll review when you ask for it or it goes out of draft.

Copy link

github-actions bot commented May 9, 2024

/en/flight_modes_rover/manual_rover.md

  • LinkedFileMissingAnchor: #RRD_SPEED_SCALE not found in ../advanced_config/parameter_reference.md (/home/runner/work/PX4-user_guide/PX4-user_guide/en/advanced_config/parameter_reference.md)
  • LinkedFileMissingAnchor: #RRD_ANG_SCALE not found in ../advanced_config/parameter_reference.md (/home/runner/work/PX4-user_guide/PX4-user_guide/en/advanced_config/parameter_reference.md)
  • PageNotInTOC: Page not in Table of Contents (/home/runner/work/PX4-user_guide/PX4-user_guide/en/SUMMARY.md)
  • PageNotLinkedInternally: Page is orphan (not linked by any other page)

/en/flight_modes_rover/mission_rover.md

  • CurrentFileMissingAnchor: [by default](#COM_RC_OVERRIDE): anchor doesn't match any heading id or element id
  • PageNotInTOC: Page not in Table of Contents (/home/runner/work/PX4-user_guide/PX4-user_guide/en/SUMMARY.md)
  • PageNotLinkedInternally: Page is orphan (not linked by any other page)

/en/config_rover/configure_rover_differential.md

  • PageNotInTOC: Page not in Table of Contents (/home/runner/work/PX4-user_guide/PX4-user_guide/en/SUMMARY.md)
  • PageNotLinkedInternally: Page is orphan (not linked by any other page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants