Skip to content

rover: offboard support through trajectorySetpoint.msg#24062

Closed
chfriedrich98 wants to merge 3 commits intoPX4:mainfrom
chfriedrich98:offboard_rover
Closed

rover: offboard support through trajectorySetpoint.msg#24062
chfriedrich98 wants to merge 3 commits intoPX4:mainfrom
chfriedrich98:offboard_rover

Conversation

@chfriedrich98
Copy link
Contributor

Solved Problem

The rover modules currently do not support offboard control through the trajectorySetpoint.msg
Fixes #23663

Solution

Add a translation layer for the rover modules to turn the trajectorySetpoint.msg into rover setpoints:

  • Mecanum: Supports position, velocity, yaw and yaw speed setpoints.
    The setpoints are prioritized in the following descending order position -> velocity and yaw -> yaw speed.
    Higher priority setpoints override lower priority ones due to the fact that they can't be achieved simultaneously.
  • Differential: Supports position, velocity, yaw and yaw speed setpoints.
    The setpoints are prioritized in the following descending order position -> velocity -> yaw -> yaw speed.
    Higher priority setpoints override lower priority ones due to the fact that they can't be achieved simultaneously.
  • Ackermann: Supports position setpoints.

Test coverage

  • Tested in simulation using ROS2

Context

Related links, screenshot before/after, video

Supports position, velocity, yaw and yaw speed setpoints
Supports position, velocity, yaw and yaw speed setpoints
@aniruddha236
Copy link

Thank you for your contribution, I happened to find this exactly when I am in the beginning of my project for having a path planner for an ackermann rover to avoid obstacles while moving towards the goal point.
I am using ROS2 Jazzy with MAVROS and Gazebo Harmonic. I cloned your fork and was testing offboard mode control with the ackermann rover. I am publishing position setpoints on the MAVROS topic /mavros/setpoint_trajectory/local. Upon providing a single MultiDOFJointTrajectoryPoint in the MultiDOFJointTrajectory with the position specified, the rover moves to this position.
What I experience is that even though the rover reaches the desired trajectory point, after some time, it begins to circle around this point (while my ros node continues to publish the same trajectory point), resulting in this:
image
This was with the NAV_ACC_RAD set to 0.5 m. Upon increasing this to 1 m, the number of circles around this trajectory point reduces. But is there a solution to avoid this?
From what I understood, the current local pose estimate keeps drifting over time and eventually causes the rover to think that it is not at the desired trajectory point and tries to move towards it and then ends up steering around it.
I wish to integrate a path planner (maybe using the ROS2 Navigation stack) and would like to get some advice on what would be the best course of action.

@aniruddha236
Copy link

I switched to using the Micro XRCE-DDS Agent & Client instead of Mavros to send the position setpoints on the TrajectorySetpoint message. I was using https://github.com/Jaeyoung-Lim/px4-offboard/tree/master and wanted to see the rover move in a circle.
image
I want to get some advice on how to improve the trajectory tracking by the rover, so that the final trajectory looks like:
image

@github-actions github-actions bot added the stale label Feb 2, 2025
@chfriedrich98
Copy link
Contributor Author

This PR has been superceded by #24285, #24318 and #24403 which introduced offboard support through the trajectorySetpoint.msg for the respective rover modules.

@chfriedrich98 chfriedrich98 deleted the offboard_rover branch February 25, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[UGV] Rover: Add support for offboard mode in the new rover modules

2 participants