R1 Rover simulation | Offboard control

I’ve been using the R1 rover mixer for controlling a boat with differential drive. In RC mode, it works well. However, the final goal is to be able to control the robot in offboard mode. Before actually using offboard mode on the boat though, I’ve been trying to run the simulation and faced issues.

I have been able to run the simulation and send offboard mode commands to go to a X,Y position. It works well for other frames but R1 rover. The R1 rover just seems to spin around before it enters failsafe mode and stops moving.

I wonder if this has to do with the PID tuning of the R1 rover? I am using the default configurations that are in the mixer, so I would presume that the parameters are correct. Has anyone else faced a similar issue? A fix would save a ton of time on my end here.

Thanks~

@utkarsh867 There are some issues with the contact model in gazebo that doesn’t work so reliably.

You can try and play around with the contact variables for each wheel: https://github.com/PX4/PX4-SITL_gazebo/blob/25138e803ee8525ee5fe4e6d511506e88e3f819c/models/r1_rover/r1_rover.sdf.jinja#L155-L168

Thank you! I will give this a try.

Hi @Jaeyoung-Lim the change in the contact model did not seem to improve anything.

Then I discovered this issue: https://github.com/PX4/PX4-Autopilot/issues/15211

This is exactly the behaviour in my simulation.

The issue, as well as it’s duplicate don’t seem to be solved but I wonder why my GPS is failing in the simulation in the first place? I have QGroundControl connected as well to monitor the simulation. After some spinning, QGroundControl enables failsafe saying “no global position” and then the robot starts sliding.

The simulations for the generic rover with ackerman steering works fine too.

Thanks

@utkarsh867 Also for boats having a rate controller might help: https://github.com/PX4/PX4-Autopilot/pull/18317

1 Like

@Jaeyoung-Lim Any reason why the PR has not been merged?

There are a few pending fixes by @Jaeyoung-Lim

Thanks for the update!

@Jaeyoung-Lim I can confirm that there is definitely something wrong with the R1 rover simulation. Just built a small DIY rover today and things seem fine in Mission and offboard mode.

Thank you for that continuous support you people! I’m sure I’ll find a way to contribute back as I explore the codebase!

Cheers~

@utkarsh867 Hi, sorry to bring this thread up again - we’ve been trying to get OFFBOARD control for PX4 rovers working and I can’t seem to find any recent instructions/posts/issues apart from this one!

Which commands are you sending to the rover to get it to move anywhere in offboard mode - are you sending positions, or doing lower level control? Also does your vehicle have GPS (ours doesnt we’re indoors…)?

We are also trying to send X,Y commands, but the vehicle (ackermann Rover for us) just moves backwards regardless of position! From looking we are using SET_POSITION_TARGET_LOCAL_NED, but it doesn’t appear to be doing anything as POSITION_TARGET_LOCAL_NED is always empty.

Thanks - Any help is appreciated, we have been stuck on this for weeks now!

1 Like

Sorry again, just clearing my own question for anybody in the future - the answer is yes you can OFFBOARD control but only with velocity setpoints on SET_POSITION_TARGET_LOCAL_NED ! See this answer for more details: PX4 Rover *Indoor* Offboard control - #2 by mhl787156