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

rover: offboard support through trajectorySetpoint.msg #24062

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

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
@chfriedrich98 chfriedrich98 added the Rover 🚙 Rovers and other UGV label Dec 2, 2024
@chfriedrich98 chfriedrich98 self-assigned this Dec 2, 2024
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rover 🚙 Rovers and other UGV
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

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