Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crazyflie 2.0 cannot get local position from mavros #9291

Closed
vuanhduy opened this issue Apr 11, 2018 · 10 comments
Closed

crazyflie 2.0 cannot get local position from mavros #9291

vuanhduy opened this issue Apr 11, 2018 · 10 comments

Comments

@vuanhduy
Copy link

vuanhduy commented Apr 11, 2018

Question

Hi all,
I am following the instruction from https://docs.px4.io/en/flight_controller/crazyflie2.html and successfully installed px4 firmware onto my Crazyflie 2.0.

I can also run cfbrigde (both C and python versions) application and mavros to communicate with the drone. I have checked the /diagnostics topic and can retrieve data from /mavros/imu/data, /mavros/battery, /mavros/altitude and /mavlink/from topics via the rostopic echo command.

I updated the drone's parameters to be able to get local information via motion capture system (EKF2_AID_MASK = 24, EKF2_HGT_MOD = vision) and setup the VRPN to transfer data from my optitrack system onto the drone.

After publishing data to /mavros/vision_pose/pose topic, I can only obtain the local position via Mavnlink Inspection feature of the QGroundControl (i.e., the LOCAL_POSITION_NED section correctly shows the information) but I cannot get it by rostopic echo /mavros/local_position/pose command. Why?

@dennisss, @barzanisar: I see that both of you also work with the crazyflie so could you give any suggestion?

@barzanisar
Copy link

Are you able to echo the topics as well as see them in QGC at the same time?

@barzanisar
Copy link

Did you connect the crazyflie with a USB cable to your PC as well? or just via crazyradio?

@barzanisar
Copy link

cfbridge starts mavlink in "osd" mode, see here.

However, osd mode of mavlink does not publish/stream LOCAL_POSITION_NED as configured here

But if you connect to QGC via USB cable, rather than cfbridge and radio, the USB connection uses config mode of mavlink which streams LOCAL_POSITION_NED see here

Try streaming LOCAL_POSITION_NED in osd mode i.e. here

@vuanhduy
Copy link
Author

@barzanisar: thank you for your reply. I have updated the mavlink option allowing to stream the LOCAL_POSITION_NED. Just my curiosity, are you also using crazyflie 2.0 for an indoor project?

@thomasgubler
Copy link
Contributor

➤ Barza Nisar commented:

yes I am.
Are you able to echo the topic now?

@thomasgubler
Copy link
Contributor

➤ Barza Nisar commented:

Also, were you able to echo the topic as well as use QGC at the same time? Or echoing stops when you switch on QGC?

@vuanhduy
Copy link
Author

Yes, I am able to echo the topic now, and I can do both (echoing and QGC) at the same time. Are you using offboard mode to fly the drone indoor?

@barzanisar
Copy link

No, I am using other modes for now. I might use offboard later on. Why?

I was not able to echo the topic as well as use QGC at the same time. Which cfbridge are you using? C based or python script? and do you launch mavros listening to the same udp port as QGC? i.e. 14550
by running roslaunch mavros px4.launch fcu_url:="udp://:[email protected]:14555" ?

@vuanhduy
Copy link
Author

Hi @barzanisar,
I am using the python version and created a launch file for it which is just a copy of px4.launch setting fcu_url to udp://:[email protected]:14556 and gsc_url to udp://@192.168.0.102:14557. (I am running the QGroundControl app on 192.168.0.102 machine and let it listen the port 14557.)

However, I'm getting some difficulties in running offboard mode. The offboard mode requires publishing the target NED position every 20 milliseconds but the drone sometimes disconnects with the radio dongle for more than 20 milliseconds which makes the drone escape the offboard mode and be out of control.

@barzanisar
Copy link

Hi @vuanhduy,
I never experienced disconnection from radio dongle myself. You can try a number of things:

  • make sure the number of retries before radio disconnects is set to a high number e.g. 1500

  • You can run this python script the same way you launch cfbridge.py to get a suggestion of good/free channels to use. Next, you can change the channel number to the suggested one in QGC via syslink parameters via USB cable connection to crazyflie first, reboot crazyflie, remove USB cable and then launch cfbridge.py with its radio channel modified

  • Try increasing COM_OF_LOSS_T

Let me know if any of these suggestions work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants