Page 1 of 1

CF 2.0 & LPS waypoint ROS example

Posted: Tue Jul 03, 2018 9:26 am
by sample
Hi everyone,

I am familiar with the python waypoint following script, and it works! I was wondering is there a similar example in ROS? I want to do it through ROS because I have to record flight data through bag.
Thanks!

Re: CF 2.0 & LPS waypoint ROS example

Posted: Tue Jul 03, 2018 6:35 pm
by whoenig
If you can point me to the "python waypoint following script", I might be able to tell you how to do it in ROS. I don't think there is an example, yet.

Re: CF 2.0 & LPS waypoint ROS example

Posted: Wed Jul 04, 2018 6:59 am
by sample
whoenig wrote: Tue Jul 03, 2018 6:35 pm If you can point me to the "python waypoint following script", I might be able to tell you how to do it in ROS. I don't think there is an example, yet.
Hi, this is the one!
https://github.com/bitcraze/crazyflie-l ... equence.py

Re: CF 2.0 & LPS waypoint ROS example

Posted: Fri Jul 06, 2018 8:17 am
by sample
I have related question. If instead of position, I want to give CF roll or pitch reference (for a few seconds, and then return it to zero), while in hover, how do I do this? As soon as CF receives the roll or pitch reference, position controller responsible for remaining CF at hover will kick in and (I guess) something weird will happen.

Thanks

Re: CF 2.0 & LPS waypoint ROS example

Posted: Sat Jul 07, 2018 1:02 am
by whoenig
For waypoint following I recommend using the new high-level command mode with "goTo" commands, see an example here: https://github.com/whoenig/crazyflie_ro ... h_level.py or here: https://github.com/USC-ACTLab/crazyswar ... ypoints.py.

A quadrotor with upward pointing rotors cannot pitch while staying at the same position by design (because all force vectors point upwards only). You can, however, just control attitude and not position; this is what's essentially happening when you fly manually using a joystick.

Re: CF 2.0 & LPS waypoint ROS example

Posted: Sat Jul 07, 2018 11:56 am
by sample
whoenig wrote: Sat Jul 07, 2018 1:02 am For waypoint following I recommend using the new high-level command mode with "goTo" commands, see an example here: https://github.com/whoenig/crazyflie_ro ... h_level.py or here: https://github.com/USC-ACTLab/crazyswar ... ypoints.py.

A quadrotor with upward pointing rotors cannot pitch while staying at the same position by design (because all force vectors point upwards only). You can, however, just control attitude and not position; this is what's essentially happening when you fly manually using a joystick.
Thank you Whoenig for your patience and hard work!, I'll give it a try on Monday.
Regarding pitch/roll, yes, I am familiar with the quadrotor dynamics, but I guess I wasn't clear. I want quad to hover at the initial position and just keep it at the constant altitude. Then I want to send pitch/roll angle references and I expect it to change the position, that's not an issue. I just don't know which launch file and topic should I use to accomplish this. Basically, I want to move quad using pitch/roll references instead of postion reference x/y. In the same way we do it with joystick inputs in dwm_loc_ekf_hover.launch, but instead of using joystick i want to publish angle reference. I am stuck with this problem, and I hope I have made myself clear enough.

Re: CF 2.0 & LPS waypoint ROS example

Posted: Tue Jul 10, 2018 7:52 pm
by whoenig
You can base your work on https://github.com/whoenig/crazyflie_ro ... ch#L18-L26, but exclude the highlighted lines and publish your goal value to the cmd_vel topic using some custom node instead.