Page 1 of 1

cmd_vel in

Posted: Tue Feb 12, 2019 1:16 pm
by aramos

My name is Agustín Ramos and I am a researcher at the University of Seville (Spain) in the group of Robotics, Vision and Control. Since a month ago we are testing the Loco Positioning System with 6 nodes in TWR mode and with one cf2. We are using ROS Kinetic, Ubuntu 16.04 and the drivers lps-ros and crazyflie_ros to do autonomous missions, following these instructions:

Analyzing the code, specifically in lps-ros/scripts/, I do not understand why in (x, y) you subscribe in goal and publish in cmd_vel directly, without a coordenates transformation between the target world and the target drone: ... py#L79-L80. I think it has no sense. I have been looking for in the code but I can not find where changes the targets. I realized that whoenig in ... pp#L75-L76 does something similar with a external PID controlller, but that has more sense because in this case there is a transform drone - world.

Another question related to the previous is about how and where the crazyflie-firmware receives this cmd_vel published in to do the internal PID controller in ... ller_pid.c. I assume that, although publishes in cmd_vel, this script uses the PIDs in position_controller_pid.c to fly (viewtopic.php?f=16&t=2474&p=12516&hilit), but I can not find how the crazyflie_firmware takes the cmd_vel topic to do the PID control.

All these doubts are because our purpose is to do autonomous missions using ROS, commanding waypoints in velocity and using the internal PID controller of the firmware, but first of all we need to understand the code we are using to improve the flight tuning the PIDs.

Thank you in advanced.
Best regards,

Re: cmd_vel in

Posted: Wed Feb 13, 2019 5:52 pm
by whoenig
For new setups I think it is best to use the TDoA 3 mode. Then, you shouldn't need lps-ros at all. Instead, all the sensor fusion/state estimation is done on-board the CFs EKF. You can use crazyflie_ros or the crazyswarm with the PID or mellinger controller for velocity control.

The controller in crazyflie_ros is essentially deprecated. I keep it around for people to see how to implement an external position controller, but the firmware now has two decent position controllers to choose from built-in, and the performance of the on-board controller is far superior to the simple controller in crazyflie_ros.

There are different control modes in the firmware, that map to different ROS topics. You can find them in ... _generic.c. If you tell me what kind of setpoint you want to send, I can tell you the appropriate ros topic (if it does exist already).

Good luck!

Re: cmd_vel in

Posted: Wed Feb 20, 2019 3:12 pm
by aramos
Thank you for your answer!!

We are already flying two cf2 in mode TDoA2 with 8 anchors (the guide recommends to use this mode for 8 anchors). Now, we're using the with more accuracy than ever. At the moment, we're sending position setpoints to the topic cmd_vel, but we would also like to command in velocity, instead of commanding position.

From the link you told me about, I understand I have to use velocityWorldType but I don't know how.

I would appreciate some guidances about this.

Thank you in advanced.

Re: cmd_vel in

Posted: Wed Feb 20, 2019 5:42 pm
by whoenig
Unfortunately, this particular one is not in crazyflie_cpp, yet. I added an issue for it Once it is there, I can also add it to crazyflie_ros using a new ROS topic.

Re: cmd_vel in

Posted: Thu Feb 21, 2019 5:05 pm
by aramos
Ok, thank you.

We remain attentive for new changes. It would be very beneficial for our research.

According to the crazyradio, we are trying to fly 3 cf2 using 1 cr. However, one of them never takes off. We have tried to add a second cr but do not get it to work properly.Although both cr are plugged in, when make a scan (with the python library or with the package crazyflie_tools) only one channel (//0/80/250k) is detected. I understand that a new channel should be assigned for a the new cr, but do not know the way to do it.

From the blog I have read that the first number of the channel should correspond with the n-th cr plugged. Hence, I expected to see a //1/... once connected the second cr. We have also tried to configure that parameter from cfclient - configure 2.0 once connected to the cf2 but does not seem to be configurable. It must be certainly a trivial issue I cannot get to figure it out.

Thank you so much in advance!

Re: cmd_vel in

Posted: Thu Feb 21, 2019 9:07 pm
by whoenig
Are you assigning unique addresses to each of the CFs? To (re)configure it is best to connect the CF over USB, especially if you change radio related parameters. Section 5.1 in [1] might also help you. The scan tools only use a single radio for the scanning. You can assign a radio, just by changing the URI (i.e., if you use //0/80/250k the first radio will connect to the CF using channel 80, if you use //1/80/250k, the second radio will connect to the CF using channel 80). If you want to use different channels, you have to change the channel of the CF. It should be fine to have 3 CFs on a single radio, though.

[1] W. Hönig and N. Ayanian. "Flying Multiple UAVs Using ROS", Chapter in Robot Operating System (ROS): The Complete Reference (Volume 2), Springer, 2017.
Pre-print at ... OS2017.pdf