New to Crazyflie, confused about ROS

Firmware/software/electronics/mechanics
Post Reply
kylefermin
Beginner
Posts: 2
Joined: Mon Mar 07, 2016 1:26 am

New to Crazyflie, confused about ROS

Post by kylefermin »

Hi guys,

We are currently working on our college thesis which wants to implement the SWEEP protocol using 4 quadcopters. Basically,the quads should follow a certain path that changes with respect to time until it converges on the point of origin which is the target. We plan on using Optitrack for detecting and stabilizing the quads and randomly generating a target.
Being fairly new to crazyflie, all of this has been confusing to me. I understand that the crazyflie-clients-python folder I have in my laptop contains all the things that I need to be able to control the quads. I was able to install them with the help of a friend based on this link (https://github.com/bitcraze/crazyflie-clients-python) I've only tried the examples and played around with the ramp code and both basiclog and basicparam examples. After searching for some inspiration online, I've seen that most people use ROS along with an external camera to do waypoint navigation. (seen here:http://wiki.ros.org/crazyflie) Downloading the file and going to the controller folder, all I see are C files which are different from the py files I've been using in pycharm. These c files are namely controller.cpp and pid.hpp.

Now, on to the question which is the point of the topic.
1. Why are the controller codes in cpp while the examples are in py?
2. Is ROS with optitrack the best method for this project? I've seen people suggest using the radio multilink branch included in python and I'm not sure if that is the better choice since ROS seems to require more installation.
3. Can I start coding the behavior of the quads from the ramp example alone by adding multiple conditional statements?
4. Have similar projects been done in the past? I see the project as dealing with dynamic waypoints and I'm hoping to take a look at some codes to get an idea of how it's done.

Thanks in advance for reading and (possibly) answering the wall of text above.

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

Re: New to Crazyflie, confused about ROS

Post by whoenig »

Hi,

I don't think that this project is going to be very easy. A few suggestions:
a) Do it in simulation first, just to make sure your waypoint computation etc. is correct. An easy to-use simulator is V-REP (http://coppeliarobotics.com/). It has a generic Quadcopter model with a waypoint controller.
b) I do suggest using ROS to avoid redoing a lot of things. You'll need to learn ROS first - there are tutorials and a good book (http://shop.oreilly.com/product/0636920024736.do).

More specifically to your questions:
1. The crazyflie_ros package does not have any dependency to the official python client. This has several reasons: a) performance (matters if you have more than 2 quadcopters), b) support for multiple crazyflies per Crazyradio (which the official client does not have). The downside is that there are some features which are not available (yet).
2. I believe it is, but I am the maintainer of the crazyflie_ros package:-) The radio multilink branch is outdated. With just 4 quads you could use 4 radios though which would work without the special branch though.
3. No - you need external feedback such as given by a motion capture system or a camera. The ramp example does not have a position controller so you won't be able to do things like waypoint following easily.
4. Waypoints are supported by the crazyflie_ros package. They are static, but it is fairly easy to generate them dynamically if you want to.

Best,

Wolfgang
kylefermin
Beginner
Posts: 2
Joined: Mon Mar 07, 2016 1:26 am

Re: New to Crazyflie, confused about ROS

Post by kylefermin »

whoenig wrote:Hi,

I don't think that this project is going to be very easy. A few suggestions:
a) Do it in simulation first, just to make sure your waypoint computation etc. is correct. An easy to-use simulator is V-REP (http://coppeliarobotics.com/). It has a generic Quadcopter model with a waypoint controller.
b) I do suggest using ROS to avoid redoing a lot of things. You'll need to learn ROS first - there are tutorials and a good book (http://shop.oreilly.com/product/0636920024736.do).

More specifically to your questions:
1. The crazyflie_ros package does not have any dependency to the official python client. This has several reasons: a) performance (matters if you have more than 2 quadcopters), b) support for multiple crazyflies per Crazyradio (which the official client does not have). The downside is that there are some features which are not available (yet).
2. I believe it is, but I am the maintainer of the crazyflie_ros package:-) The radio multilink branch is outdated. With just 4 quads you could use 4 radios though which would work without the special branch though.
3. No - you need external feedback such as given by a motion capture system or a camera. The ramp example does not have a position controller so you won't be able to do things like waypoint following easily.
4. Waypoints are supported by the crazyflie_ros package. They are static, but it is fairly easy to generate them dynamically if you want to.

Best,

Wolfgang
That's great! Thanks for the reply, I will download V-REP now and start learning ROS immediately. There are 4 people in the group so we'll try to distribute this load to be as efficient as possible. Thanks again!
binx
Beginner
Posts: 11
Joined: Tue Feb 07, 2017 4:42 am

Re: New to Crazyflie, confused about ROS

Post by binx »

whoenig wrote:Hi,

I don't think that this project is going to be very easy. A few suggestions:
a) Do it in simulation first, just to make sure your waypoint computation etc. is correct. An easy to-use simulator is V-REP (http://coppeliarobotics.com/). It has a generic Quadcopter model with a waypoint controller.
b) I do suggest using ROS to avoid redoing a lot of things. You'll need to learn ROS first - there are tutorials and a good book (http://shop.oreilly.com/product/0636920024736.do).

More specifically to your questions:
1. The crazyflie_ros package does not have any dependency to the official python client. This has several reasons: a) performance (matters if you have more than 2 quadcopters), b) support for multiple crazyflies per Crazyradio (which the official client does not have). The downside is that there are some features which are not available (yet).
2. I believe it is, but I am the maintainer of the crazyflie_ros package:-) The radio multilink branch is outdated. With just 4 quads you could use 4 radios though which would work without the special branch though.
3. No - you need external feedback such as given by a motion capture system or a camera. The ramp example does not have a position controller so you won't be able to do things like waypoint following easily.
4. Waypoints are supported by the crazyflie_ros package. They are static, but it is fairly easy to generate them dynamically if you want to.

Best,

Wolfgang

Hi Wolfgang,

Thanks for your contribution to the crazyflie_ros package shared on GitHub. I am also a beginner to both ROS and Crazyflie. So I do have problems with how to get started, although these questions might seem naïve and stupid. The questions are as follows:

Q1. Since this package is independent of the official python client, does this mean that just downloading crazyflie_ros package is sufficient for controlling the Crazyflie Quadrotor?
Q2. As you said in the GitHub, the crazyflie_demo is used to help get quick start with the usage of the crazyflie_ros package. While I still not understand how to use this package, could you explain in details about that? I have tested with hover_vicon, rviz could pop up while in the GUI the are errors with model and transform. How I can solve these problems?

Thanks a lot in advance.

Bin
Last edited by binx on Wed Feb 08, 2017 11:03 pm, edited 1 time in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New to Crazyflie, confused about ROS

Post by arnaud »

Hi,

Just a note about the python lib: we have recently fixed the support for more than one Crazyflie in the master branch (inspired by the way you share the radio in the ROS driver Wolfgang ;-)). There is a multiramp example: https://github.com/bitcraze/crazyflie-l ... ltiramp.py. And an example that makes 2 crazyflie follow position setpoints: https://github.com/bitcraze/crazyflie-l ... equence.py.

The GUI client does not support more than one Crazyflie (and this is not planed in a near/mid future).

That said, I agree with Wolfgang: ROS is a better environment for carrying such project.
binx
Beginner
Posts: 11
Joined: Tue Feb 07, 2017 4:42 am

Re: New to Crazyflie, confused about ROS

Post by binx »

arnaud wrote:Hi,

Just a note about the python lib: we have recently fixed the support for more than one Crazyflie in the master branch (inspired by the way you share the radio in the ROS driver Wolfgang ;-)). There is a multiramp example: https://github.com/bitcraze/crazyflie-l ... ltiramp.py. And an example that makes 2 crazyflie follow position setpoints: https://github.com/bitcraze/crazyflie-l ... equence.py.

The GUI client does not support more than one Crazyflie (and this is not planed in a near/mid future).

That said, I agree with Wolfgang: ROS is a better environment for carrying such project.
Hi, arnaud.

I am recently working with crazyflie quadrotor. While I am quite confused about controlling this nano quadrotor. I just cannot figure out how to control this nano quadrotor with ROS. There are so many pkg on ROS, and I don't know which one to choose. Do I need to install crazyflie_client_python to control it? Both ROS and Crazyflie is new to me. I hope you can forgive me for these stupid questions. Thanks a lot in advance.

Bin
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: New to Crazyflie, confused about ROS

Post by arnaud »

Hi Bin,

As Wolfgang noted the ROS driver and the Crazyflie python lib/client are two different independent projects. They are kind of complementary though so while you do not need crazyflie_client_python top control the Crazyflie with ROS it might be good to have it on the side for manual flight and configuration of the Crazyflie (I think there is a tool to configure the Crazyflie in ROS but I have never used it ...).

To control Crazyflie with ROS you need this package: https://github.com/whoenig/crazyflie_ros. The readme contains the documentation to get you started by operating the Crazyflie with a Gamepad. If you want a walk-throw documentation I have listed the steps to get ROS up and running for our local positioning system: https://wiki.bitcraze.io/doc:lps:index#ros. You can ignore the information relative to the LPS but it should give you an idea on how to get started.

/Arnaud
Post Reply