Controlling Crazyflie with LPS

All discussions related to the Loco Positioning system
Post Reply
youngbin1130
Beginner
Posts: 15
Joined: Thu Dec 12, 2019 4:28 am

Controlling Crazyflie with LPS

Post by youngbin1130 » Mon Mar 02, 2020 9:23 am

Hi,

I was looking through the Python library for Crazyflie but I'm confused about where I should start for my project because, from what I understand, there are alot of similar functions.

I would just like to see where the following functions are:
1. The turning velocity
2. Moving from Point A to Point B (In world space)
3. Moving along the relative X, Y, Z

I would also like to ask if I start off with a single Crazyflie, whether the functions can be accommodated for a Swarm in the future.

Cheers,
Youngbin



kimberly
Bitcraze
Posts: 250
Joined: Fri Jul 06, 2018 11:13 am

Re: Controlling Crazyflie with LPS

Post by kimberly » Mon Mar 02, 2020 3:42 pm

Hi.

So the examples/position_commander_demo.py in that same repo is already doing number 2 and 3 of your request. Motion_commander_demo.py does 1 and 3 but do be carefule of mixing the types of 'commanders' (see this issue).

You can look in the examples/swarm/ folder for some examples for flying multiple Crazyflies at the same time.

youngbin1130
Beginner
Posts: 15
Joined: Thu Dec 12, 2019 4:28 am

Re: Controlling Crazyflie with LPS

Post by youngbin1130 » Fri Mar 06, 2020 5:57 am

Hi,

Thanks for your reply!

I had forgotten to mention that if all my questions take into account the boundary set by the LPS nodes.

Also, I think you had forgotten to link the issue which you wanted to mention when mixing two kinds of commanders.

kristoffer
Bitcraze
Posts: 204
Joined: Tue Jun 30, 2015 7:47 am

Re: Controlling Crazyflie with LPS

Post by kristoffer » Fri Mar 06, 2020 9:28 am

I had forgotten to mention that if all my questions take into account the boundary set by the LPS nodes.
I'm not sure what you mean, could you please explain a bit further?

The issue Kimberly referred to was https://github.com/bitcraze/crazyflie-f ... issues/536

youngbin1130
Beginner
Posts: 15
Joined: Thu Dec 12, 2019 4:28 am

Re: Controlling Crazyflie with LPS

Post by youngbin1130 » Thu Mar 12, 2020 3:09 am

Hi,

Basically, I would like to control the Crazyflie to move from (x,y,z) to (x1,y1,z1) within inside the LPS "box" while being able to access low level commands.

I have taken a look at the examples/position_commander_demo.py and tested it on my Crazyflie. It seems to behave a little strangely on my Crazyflie. When running the first "pc.forward(1.0)", I've noticed that the Crazyflie flies backwards diagonally and I'm not sure what the expected behaviour is. Here is the link to the video: https://youtu.be/7WKfWd7pX-s

Also after further research, I've noticed that examples/autonomousSequence.py has a similar function (moving from Point x,y,z to x1,y1,z1) using the set_position setpoint. How is this different with the position_commander_demo.py or is there any difference at all?

kristoffer
Bitcraze
Posts: 204
Joined: Tue Jun 30, 2015 7:47 am

Re: Controlling Crazyflie with LPS

Post by kristoffer » Mon Mar 16, 2020 12:59 pm

Thanks!

That looks a bit weird. your system set up looks pretty good, I guess you have double checked that the anchors positions are correct?
Just to make sure, the Crazyflie must be oriented facing the positive X direction when taking off.

pc.forward(1.0) should move one meter in the forward direction.

Maybe you should start by taking off and landing. The easiest way should be to replace the motion commands with a time.sleep(5)
Also after further research, I've noticed that examples/autonomousSequence.py has a similar function (moving from Point x,y,z to x1,y1,z1) using the set_position setpoint. How is this different with the position_commander_demo.py or is there any difference at all?
There are many ways to do it :-)
In the autonomousSequence.py script we continuously send setpoints to the Crazyflie. In position_commander_demo.py the high level commander handles that on board the Crazyflie instead.

Post Reply