CF 2.0 & LPS waypoint ROS example

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
sample
Beginner
Posts: 9
Joined: Wed May 02, 2018 1:57 pm

CF 2.0 & LPS waypoint ROS example

Post by sample » Tue Jul 03, 2018 9:26 am

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!

whoenig
Expert
Posts: 270
Joined: Mon Oct 27, 2014 2:55 am

Re: CF 2.0 & LPS waypoint ROS example

Post by whoenig » 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.

sample
Beginner
Posts: 9
Joined: Wed May 02, 2018 1:57 pm

Re: CF 2.0 & LPS waypoint ROS example

Post by sample » Wed Jul 04, 2018 6:59 am

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

sample
Beginner
Posts: 9
Joined: Wed May 02, 2018 1:57 pm

Re: CF 2.0 & LPS waypoint ROS example

Post by sample » Fri Jul 06, 2018 8:17 am

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

whoenig
Expert
Posts: 270
Joined: Mon Oct 27, 2014 2:55 am

Re: CF 2.0 & LPS waypoint ROS example

Post by whoenig » 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.

sample
Beginner
Posts: 9
Joined: Wed May 02, 2018 1:57 pm

Re: CF 2.0 & LPS waypoint ROS example

Post by sample » Sat Jul 07, 2018 11:56 am

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.

whoenig
Expert
Posts: 270
Joined: Mon Oct 27, 2014 2:55 am

Re: CF 2.0 & LPS waypoint ROS example

Post by whoenig » Tue Jul 10, 2018 7:52 pm

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.

Post Reply