# PX4 =\> ROS Node Communication Setup for Rovers

**URL:** <https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368>\
**Category:** Uncategorized\
**Created:** [April 26, 2016, 6:48pm UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368 "2016-04-26T18:48:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![blubbi321](https://discuss.px4.io/user_avatar/discuss.px4.io/blubbi321/32/9140_2.png) [@blubbi321](https://discuss.px4.io/u/blubbi321)\
**Post date:** [April 26, 2016, 6:48pm UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/1 "2016-04-26T18:48:16Z")

</div>

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](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](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:
- 

```auto

```

[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

```auto
 * 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!
```

---

<div class="post-metadata">

**Author:** ![blubbi321](https://discuss.px4.io/user_avatar/discuss.px4.io/blubbi321/32/9140_2.png) [@blubbi321](https://discuss.px4.io/u/blubbi321)\
**Post date:** [April 27, 2016, 8:57pm UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/2 "2016-04-27T20:57:44Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![blubbi321](https://discuss.px4.io/user_avatar/discuss.px4.io/blubbi321/32/9140_2.png) [@blubbi321](https://discuss.px4.io/u/blubbi321)\
**Post date:** [April 27, 2016, 9:48pm UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/3 "2016-04-27T21:48:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![saryee](https://discuss.px4.io/user_avatar/discuss.px4.io/saryee/32/4910_2.png) [@saryee](https://discuss.px4.io/u/saryee)\
**Post date:** [August 19, 2016, 8:06pm UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/5 "2016-08-19T20:06:48Z")

</div>

Use the code in the link [http://dev.px4.io/ros-mavros-offboard.html](http://dev.px4.io/ros-mavros-offboard.html) like:  
if( set\_mode\_client.call(offb\_set\_mode) &&  
offb\_set\_mode.response.success){  
ROS\_INFO(“Offboard enabled”);  
}  
I can change the mode to OFFBOARD. And used the code like:  
if( arming\_client.call(arm\_cmd) &&  
arm\_cmd.response.success){  
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](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!

 ![](https://discuss.px4.io/uploads/default/original/1X/ce4b21cbab9d2fa0fb00fee4a34e593f7c11b339.png)

---

<div class="post-metadata">

**Author:** ![ealdaz](https://discuss.px4.io/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://discuss.px4.io/u/ealdaz)\
**Post date:** [April 10, 2017, 10:43am UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/6 "2017-04-10T10:43:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andresR8](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andresR8](https://discuss.px4.io/u/andresR8)\
**Post date:** [July 6, 2017, 2:01am UTC](https://discuss.px4.io/t/px4-ros-node-communication-setup-for-rovers/368/7 "2017-07-06T02:01:53Z")

</div>

I had the same issue with the tutorial ( [https://pixhawk.org/dev/ros/ground\_rover](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.
