# Cfbridge - Transform, To communicate with Mavros

**URL:** <https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192>\
**Category:** Uncategorized\
**Created:** [January 16, 2017, 6:29am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192 "2017-01-16T06:29:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taein](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@Taein](https://discuss.px4.io/u/Taein)\
**Post date:** [January 16, 2017, 6:29am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/1 "2017-01-16T06:29:40Z")

</div>

I think that the original purpose of cfbridge is connecting ‘CrazyRadio PA’ and ‘GCS (like Qgroundcontrol)’. But, I want to that cfbridge connects CrazyRadio PA and mavros. (like that serial connect CF 2.0 with mavros by using USB connection (`"/dev/ttyACM0"`) ). So I think, Source code of cfbridge should be revised.

Analyzing Source code of cfbridge is so hard… (I am second year collage student ) In my opinion, cfbridge should be added source code that have a similar function px4 connect to mavros.

Ultimately, what I want is to connect CF2 to mavros using cfbridge and receive CF2 data from mavros by using ubuntu terminal command `"rostopic echo"`.

---

<div class="post-metadata">

**Author:** ![Taein](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@Taein](https://discuss.px4.io/u/Taein)\
**Post date:** [January 16, 2017, 11:57am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/2 "2017-01-16T11:57:24Z")

</div>

how do you think? @dennisss  
I think you are the expert in this field…

---

<div class="post-metadata">

**Author:** ![dennisss](https://discuss.px4.io/user_avatar/discuss.px4.io/dennisss/32/3541_2.png) [@dennisss](https://discuss.px4.io/u/dennisss)\
**Post date:** [January 16, 2017, 6:13pm UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/3 "2017-01-16T18:13:34Z")

</div>

I will try to verify mavros support later today once I am in my lab.

As far as I can tell, there should not be any needed design changes to use mavros rather than QGC with cfbridge. Can you please confirm that cfbridge is able to connect to QGC?

Connecting mavros to cfbridge should be the same procedure as for connecting mavros to an SITL simulation as both communicate over local udp ports.

Something like this should work:  
`roslaunch mavros px4.launch fcu_url:="udp://:14550@127.0.0.1:14555"`. 14550 and 14555 may need to be flipped. I will confirm later today.

Edit:  
I’ve confirmed that the above command does work and I am above to echo telemetry data through mavros

---

<div class="post-metadata">

**Author:** ![Taein](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@Taein](https://discuss.px4.io/u/Taein)\
**Post date:** [January 17, 2017, 5:42am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/4 "2017-01-17T05:42:55Z")

</div>

@dennisss , I am always thankful for your kindness. Thank you very much. Thanks to you, I am motivated and motivated to study. I understood everything you said. Is  
it possible to receive data via `rostopic echo / mavros / imu / data_raw` from`mavros px4.launch` just by modifying fcu\_url of  
px.launch file without modifying cfbridge?

As far as I can confirm, I can check the data\_raw data by connecting  
“Crazyflie2.0” to the serial port using USB and modifying `fcu_url =" seral: /// dev / ttyACM0: 57600 "`. I can not get data\_raw with UDP communication using CrazyRadio PA and cfbridge.

\*\*Edit:  
I’ve confirmed that cfbridge can connect to QGC.

---

<div class="post-metadata">

**Author:** ![dennisss](https://discuss.px4.io/user_avatar/discuss.px4.io/dennisss/32/3541_2.png) [@dennisss](https://discuss.px4.io/u/dennisss)\
**Post date:** [January 17, 2017, 11:59am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/5 "2017-01-17T11:59:12Z")

</div>

This is my setup for making this work:

1. I have three terminals.  
First I start one on the right to connect cfbridge  
Next I use bottom-left one to connect mavros  
Finally I use top-left one to print data from mavros. I got `/mavros/imu/data` by doing `rostopic list` and then picking an interesting one from the list  

2. This is the result of running those commands:

---

<div class="post-metadata">

**Author:** ![Taein](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@Taein](https://discuss.px4.io/u/Taein)\
**Post date:** [January 19, 2017, 5:56am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/6 "2017-01-19T05:56:59Z")

</div>

thanks to reply, @dennisss!! I understood and analyzed the screen image that you attached.  
Um… I have the same screen as you. But I would like to ask you to “echo” the `"/mavros/imu/data_raw"` from the “rostopic list” instead of `"/mavros/imu/data"`. Do you receive data? I do not get any data. But when I connected Crazyflie to the serial port via USB, `"/imu/data_raw"` data came in. If you use “cfbridge”, the `"/imu/data_raw"` data will not come in. Please check this part.

---

<div class="post-metadata">

**Author:** ![dennisss](https://discuss.px4.io/user_avatar/discuss.px4.io/dennisss/32/3541_2.png) [@dennisss](https://discuss.px4.io/u/dennisss)\
**Post date:** [January 19, 2017, 3:50pm UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/7 "2017-01-19T15:50:34Z")

</div>

data\_raw is not configured to be transmitted over the radio as we would like to by default limit the amount of non-essential data going over the connection.

Mavlink in PX4 has different modes which define how much data is sent. This line specified that the crazyflie should be in osd mode: [https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu\_common/init.d/rcS#L630](https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/rcS#L630).

If you examine the mavlink program ([https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink\_main.cpp#L2047](https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_main.cpp#L2047)), osd mode does not send HIGHRES\_IMU which is what data\_raw listens to. Meanwhile, usb is usually configured in normal mode ([https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink\_main.cpp#L1988](https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_main.cpp#L1988)) which sends just about everything including HIGHRES\_IMU.

Please consider either changing the mode in the rcS file, or adding custom streams to mavlink if you really need this data.

---

<div class="post-metadata">

**Author:** ![Taein](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@Taein](https://discuss.px4.io/u/Taein)\
**Post date:** [January 20, 2017, 6:17am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/8 "2017-01-20T06:17:14Z")

</div>

Thanks, @dennisss !!  
You solve my main problem that give pain to me for 2 weeks…!  
Have a nice day! dennisss!

---

<div class="post-metadata">

**Author:** ![virtualclone](https://discuss.px4.io/letter_avatar_proxy/v4/letter/v/839c29/32.png) [@virtualclone](https://discuss.px4.io/u/virtualclone)\
**Post date:** [October 24, 2017, 4:09am UTC](https://discuss.px4.io/t/cfbridge-transform-to-communicate-with-mavros/2192/9 "2017-10-24T04:09:43Z")

</div>

hi @dennisss when you echo /mavros/imu/data ,is it normal?  
because when I echo /mavros/imu/data , it echos very slowly  
but when I connect Crazyflie to computer by USB ,it echos normal.  
Is there problems with my Crazyradio PA?  
Do I need to upload any other software to it?
