Page 1 of 1

Trajectory for crazyflie

Posted: Fri Jan 15, 2021 3:30 am
by Ruocheng
Hi,
recently I'm trying to fly trajectories in crazyflie_ros, but there are some issues ...
(1)In the crazyflie-firmware/src/modules/src, I found the controller_mellinger.c, but when I use this controller, the cf flies very aggressive and crashed.This problem will disappear when using the PID controller.
I wonder if the mellinger controller must use the full state, while right now I send the cmd_position.

(2)How can I use the pptraj.c ? I have read this code and I'm familiar with the minimum snap theory, however I'm not clear with the whole procedure to employ the trajectory to the cf.

Thanks a lot!!!!!

Re: Trajectory for crazyflie

Posted: Fri Jan 15, 2021 7:39 am
by whoenig
(1) The mellinger controller has very high gains in order to accurately track a trajectory. In practice, this means that you'll need both a very accurate state estimate (it was tuned for a VICON motion capture system) and an accurate setpoint with higher-order terms (velocity, accelerations). It should be possible to relax this assumption by reducing the gains.

(2) You can generate trajectories, for example, by using the tools at https://github.com/whoenig/uav_trajectories. An example on how to use such trajectories is available at https://github.com/whoenig/crazyflie_ro ... h_level.py. Note that a current limitation is that you need to upload trajectories while the CF is on the ground.

If you are starting out new, I recommend using the Crazyswarm rather than crazyflie_ros.

Re: Trajectory for crazyflie

Posted: Fri Jan 15, 2021 2:00 pm
by Ruocheng
Hi professor Hoenig:

Thanks for your reply! I will have a try tomorrow!!

I have already wrote a minimum snap ros node to generate a trajectory, which outputs position, velocity and acceleration. Can I integrate it with cf? And what should I pub to the crazyflie_server? cmd_fullstate or something else?

I'm also trying to integrate an octomap with the Motion capture system, then I can use path finding + trajectory optimization to do some assuming experiments XD.

Thanks a lot! Have a nice day!

Re: Trajectory for crazyflie

Posted: Mon Jan 18, 2021 9:29 pm
by whoenig
For the integration you can use the `cmd_fullstate` topic. For the octomap, you can have a look at octomap_server, which allows you to build maps easily if you add motion capture markers to your RGB-D camera (or similar sensor).