cmd_vel in

All discussions related to the Loco Positioning system
Post Reply
Posts: 1
Joined: Tue Feb 12, 2019 10:27 am

cmd_vel in

Post by aramos » Tue Feb 12, 2019 1:16 pm


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,

Posts: 290
Joined: Mon Oct 27, 2014 2:55 am

Re: cmd_vel in

Post by whoenig » Wed Feb 13, 2019 5:52 pm

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!

Post Reply