PX4 => ROS Node Communication Setup for Rovers

Hey everybody,

trying to keep everything together in this thread (as I have made a couple of attempts on the gitter channel already)

I am trying to coomplete the steps from https://pixhawk.org/dev/ros/ground_rover
However, things seem to have changed since that tutorial was written. In the meantime I have translated the code from http://dev.px4.io/ros-mavros-offboard.html into python using rospy and can send the required messages. Still using rosrun mavros xxx to set offboard mode and arm, but that is not the problem.

So this is what I did:

  • Start the Pixhawk (PX4 from master, as suggested by the tutorial)
  • Start the ROS node on a Pi2, connected via USB (yes I know this is bad, didnt find reasons why though)
  • Start publishing setpoint messages (x=0, y=0, z=2) to /mavros/setpoint_position/local with 10Hz
  • Enable offboard mode with rosrun mavros mavsys mode -c OFFBOARD
  • Response of the client command: Mode changed.
  • Response on the ROS node: CMD: Unexpected command 176, result 0
  • Arm the Pixhawk with `rosrun mavros mavsafety arm
  • Response:

[ INFO] [1461696138.107446428]: FCU: [cmd] ARMED by arm/disarm component command
[ERROR] [1461696138.156739718]: FCU: DL and GPS lost: flight termination
[ WARN] [1461696138.248203461]: TM: Clock skew detected (-0.010448943 s). Hard syncing clocks.
[ INFO] [1461696138.259433207]: FCU: [blackbox] /fs/microsd/log/2016-04-24
[ INFO] [1461696138.310534615]: FCU: [blackbox] recording: 22_04_37.px4log
[ERROR] [1461696138.362274040]: FCU: DL and GPS lost: flight termination
[ERROR] [1461696139.386047750]: FCU: DL and GPS lost: flight termination
[ERROR] [1461696140.458426575]: FCU: DL and GPS lost: flight termination

 * The last message keeps repeating, commands sent to the motors are ignored.

Now I really dont know where to look further - help would be greatly appreciated :slight_smile:

Thanks in advance!

Ok I could get rid of the FCU: DL and GPS lost: flight termination message by enabling all circuit breakers. But there is still no reaction on the motor channels when I send the ROS messages …

Also checked: I can control the motors via RC in manual mode just fine … so I think errors there can be excluded. Also the RC messages from the receiver make it into ros topics via mavros, as I can view them in rqt_plot.

Use the code in the link http://dev.px4.io/ros-mavros-offboard.html like:
if( set_mode_client.call(offb_set_mode) &&
ROS_INFO(“Offboard enabled”);
I can change the mode to OFFBOARD. And used the code like:
if( arming_client.call(arm_cmd) &&
ROS_INFO(“Vehicle armed”);
I can arm the vehicle. But now problem is no matter what values I changed for the yaw, roll, pitch, throttle like in the example https://pixhawk.org/dev/ros/ground_rover, the output PWM has no change.

Is there anybody could give me a suggestion on what I should check?

Many thanks!

Did you guys make any progress on this?
Please share how you got it to work if so.

I had the same issue with the tutorial ( https://pixhawk.org/dev/ros/ground_rover). I figured out that there’s a typo in the example code for the ros publisher

ros::Publisher actuator_controls_pub = nh.advertise<mavros::ActuatorControl>("/mavros/actuator_controls", 1000);

should be “/mavros/actuator_control” :

ros::Publisher actuator_controls_pub = nh.advertise<mavros::ActuatorControl>("/mavros/actuator_control", 1000);

That’s the correct topic at which mavros is subscribed.