How do I control a px4-based rover?

I am trying to test and build an outdoor rover based on PX4 messages. However, the rover in the simulation does not move as I intend. I found and am using this link (https://github.com/ARK-Electronics/ark_rover_demo/blob/d3e7e9d9c67dde2af60cac3c3c86df9a166e9ad4/ark_rover/ark_rover/rover_control.py), but the control is not behaving as I would like.

Could you please guide me on the topics and methods required to control the rover? I am using Ubuntu 22.04 and ROS2 Humble. Thank you!

I have never tried this.

Assuming you are using PX4 v1.15 or earlier with the old rover module, then the MAVLink messages/values you can use in offboard mode are those documented here: Offboard Mode (Generic/All Frames) | PX4 Guide (main)

Those MAVLink messages map to particular uorb topics. The mapping isn’t documented but can be inferred from the names. You can also see what they might be in action by looking at the script you are pointing to. In other words, you can work out what topics to set from the mavlink messages, and see how that works in practice using the script.

@bradstaff Might be able to advise you if you can explain what you mean by “the script isn’t behaving as you would like”.

1 Like

hello @hamishwillee !

am new to this btw so just to make it straight. can i control the rover over these Offboard Mode (Generic/All Frames) | PX4 Guide (main) mavlink messages ? because i wasnt able to move the rover with using “/fmu/in/trajectory_setpoint” topic i think this is only for copter and i have to use px4_msgs::msg::VehicleThrustSetpoint + px4_msgs::msg::VehicleTorqueSetpoint
these to make the movement. am i right ?

also one more thing its off the topic.

why is this topic: PX4-Autopilot/msg/RoverDifferentialSetpoint.msg at 01549a58326c47cf562dc190f7fa6eaf966516cc · PX4/PX4-Autopilot · GitHub not present between PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml at 01549a58326c47cf562dc190f7fa6eaf966516cc · PX4/PX4-Autopilot · GitHub

cant i use this topic to control the rover ?

First you need to check it is actually in the source for the version you are interested in. IF it is, then if itt is not in YAML that means it is compiled into PX4, but not into the XRCE dds client-side libraries. That means you’d have to rebuild PX4 with the Yaml updated to include the topics. This is documented in the ROS2/DDS docs.

After that it would be available to you, but untested for use with ROS (i.e. it should work, but you won’t find docs or anything

1 Like

right now am acually using the latest version of px4

also am able to see the topics

/fmu/in/actuator_motors
/fmu/in/actuator_servos
/fmu/in/arming_check_reply
/fmu/in/aux_global_position
/fmu/in/config_control_setpoints
/fmu/in/config_overrides_request
/fmu/in/distance_sensor
/fmu/in/goto_setpoint
/fmu/in/manual_control_input
/fmu/in/message_format_request
/fmu/in/mode_completed
/fmu/in/obstacle_distance
/fmu/in/offboard_control_mode
/fmu/in/onboard_computer_status
/fmu/in/register_ext_component_request
/fmu/in/sensor_optical_flow
/fmu/in/telemetry_status
/fmu/in/trajectory_setpoint
/fmu/in/unregister_ext_component
/fmu/in/vehicle_attitude_setpoint
/fmu/in/vehicle_command
/fmu/in/vehicle_command_mode_executor
/fmu/in/vehicle_mocap_odometry
/fmu/in/vehicle_rates_setpoint
/fmu/in/vehicle_thrust_setpoint
/fmu/in/vehicle_torque_setpoint
/fmu/in/vehicle_trajectory_bezier
/fmu/in/vehicle_trajectory_waypoint
/fmu/in/vehicle_visual_odometry
/fmu/out/battery_status
/fmu/out/estimator_status_flags
/fmu/out/failsafe_flags
/fmu/out/manual_control_setpoint
/fmu/out/position_setpoint_triplet
/fmu/out/sensor_combined
/fmu/out/timesync_status
/fmu/out/vehicle_attitude
/fmu/out/vehicle_command_ack
/fmu/out/vehicle_control_mode
/fmu/out/vehicle_global_position
/fmu/out/vehicle_gps_position
/fmu/out/vehicle_land_detected
/fmu/out/vehicle_local_position
/fmu/out/vehicle_odometry
/fmu/out/vehicle_status
/parameter_events
/rosout

this is the new topic i wrote the details

There are two versions of Rover in the latest PX4. I assume you’re using the older implementation, since the newer one doesn’t have an offboard mode.

The only things I know about using it with offboard mode are with MAVLink, as per Offboard Mode (Generic/All Frames) | PX4 Guide (main)

So if that doesn’t help, hopefully someone else will have some thoughts.

FYI @Christian_Friedrich IN case you have some experience with controlling Rover via offboard, or can recommend someone to ask.

The latest batch of changes added the first iteration for offboard mode. This provides support for the trajectorySetpoint.msg to be used for offboard control.
I tested this with ROS2, but I do not yet have any experience with the other offboard methods.
There is no documentation on this yet on the PX4 user guide because I intend to first align it with Offboard Mode (Generic/All Frames) | PX4 Guide (main) which currently does not apply to the new rover modules.

1 Like