-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#70 Improved take off/landing of swarm sequence
Using velocity control for take off and landing to avoid problems if the crazyflies are not on the correct starting points
- Loading branch information
1 parent
b3656e3
commit 8bdd63b
Showing
1 changed file
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running this with 1 crazyflie, how can I get the position data from the Crazyflie? I would like to be able to debug where the Crazyflie actually thinks it is.
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The position is available as log data from the Crazyflie.
You will have to set up a subscription for the appropriate log data and will receive the data through a callback.
Take a look at the autonomousSequence.py example for an implementation.
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working with bcmack on a senior project using the crazyflie 2.0. We were able to get the position data just like you said. But we are still not able to get the crazyflie to go to a desired position.
In autonomousSequence.py, you are using the commander.send_setpoint() command to give the desired location you want the crazyflie to go. I noticed in commander.py that this function takes in pitch, roll ,yaw, and thrust; not x, y, z, yaw. How are the pitch, roll, yaw, and thrust being applied to take the crazyflie to a specific location?
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We figured out our issue. We did not realize that a yaw of 0 corresponds to the front of the drone facing the positive x-axis, not the positive y-axis, as we were thinking.
p.s. The autonomous sequence example works great, we hope to expand to the swarm sequence in the coming weeks.
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API is a bit confusing, due to historical reasons. There is on going work (bitcraze/crazyflie-firmware#293) that hopefully will sole the problem in the future.
The line
cf.param.set_value('flightmode.posSet', '1')
sets the crazyflie in position control mode.
The method
def send_setpoint(self, roll, pitch, yaw, thrust):
in the Commander class, gets a new meaning in position control mode, something like this
def send_setpoint(self, pos_x_in_m, pos_y_in_m, yaw, pos_z_in_mm):
Note the mixup of meters for x and y while z is expressed in millimeters.
set all to 0 to turn off the motors.
comander.send_setpoint(0, 0, 0, 0)
Sounds exciting with a swarm, please share any awesomeness! Drop us an email at [email protected]
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are working on flying 2 Crazyflies with the swarm sequence. However, the program is hanging on "Waiting for estimator to find position". The Crazyflies aren't getting their positions from the loco decks. Is there something we need to do with the LOCO setup that is different from the autonomousSequence?
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
This means that the Kalman position estimator does not converge.
No, should not be any difference regarding the scripts.
You have to run the LPS system in TDoA mode though to support multiple copters. The TDoA mode is a bit more sensitive to anchor placements, try to put the copters on a box or something to move them closer to the center of the flying space (well inside the convex hull) to see if it makes a difference. In some cases it seems as the estimator does not converge if the copter is in the same plane as the anchors (or even under), for instance when it is on the floor.
We try to use github issues for bug reports or feature requests and prefer to handle support questions in the forum. The idea is to collect all information about how to use the system in one place to make it easier for other users to find it. Would it be possible for you post a question about this in the forum instead?
8bdd63b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can post it there shortly.