-
Notifications
You must be signed in to change notification settings - Fork 827
Description
Hi,
I am using PX4 SITL to control actuators via ROS2 as my MPC output motor force for the quadrotor. Specifically, I am sending commands to the /fmu/in/actuator_motors
topic at 1000Hz. However, I have observed different behaviours depending on the control mode:
Position Control Mode:
The corresponding actuator_motors uORB topic in PX4 runs at 1250Hz.
The real-time ratio in Gazebo remains at 1, which is perfect.
I suspect that this 1250Hz frequency results from the default 250Hz position control in PX4 combined with my 1000Hz ROS2 commands.
Off-Board Mode:
The actuator_motors uORB topic frequency matches my input rate of 1000Hz, as expected.
However, the Gazebo real-time ratio drops to about 0.8 to 0.9, which is not very stable, and the frequency of other uORB topics decreases. When sending motor command via ROS2 at 500Hz, it will drop to about 0.4.
Possible Cause
I suspect this issue might be related to a clock synchronization mismatch between the simulation clock in PX4 SITL and the ROS2 system clock.
Questions
-
Why does the real-time ratio drop in Gazebo when switching to Off-Board mode, while it remains stable in Position Control mode?
-
Is the clock synchronization between ROS2 and PX4 SITL affecting the frequency of uORB topics?
-
Between
px4_sitl
andpx4_sitl_nolockstep
, which one is better suited foractuator_motors
level control simulation?