hi i am a college student and i want to add a infrared proximity sensor to the crazyflie 2.0 and want to control the flight i.e. thrust, yaw, pitch, roll based on the sensor's values. can anyone tell me how can i do that and also there are plenty of variables in the stabilizer.c so can anyone tell me which variable is dealing with what kind of value in the firmware.
thank you
i want to add sensors
Re: i want to add sensors
Hi,
Sorry apparently I missed your message in the other thread.
I think the point 2 of this answer could help: http://forum.bitcraze.se/viewtopic.php? ... er.c#p7534
Basically you will have to replace or modify the setpoints sent by the controller at https://github.com/bitcraze/crazyflie-f ... zer.c#L197. What you want to modify is eulerRollDesired, eulerPitchDesired, and eulerYawDesired as well as actuatorThrust (a bit bellow).
I would have one advice: for prototyping you can try to setup a log variable to your distance sensor and implement the control loop in python (receive the log in python and send the setpoints using cflib). This way you can debug your sensor and algorithm before having to deeply modify the control codes.
Sorry apparently I missed your message in the other thread.
I think the point 2 of this answer could help: http://forum.bitcraze.se/viewtopic.php? ... er.c#p7534
Basically you will have to replace or modify the setpoints sent by the controller at https://github.com/bitcraze/crazyflie-f ... zer.c#L197. What you want to modify is eulerRollDesired, eulerPitchDesired, and eulerYawDesired as well as actuatorThrust (a bit bellow).
I would have one advice: for prototyping you can try to setup a log variable to your distance sensor and implement the control loop in python (receive the log in python and send the setpoints using cflib). This way you can debug your sensor and algorithm before having to deeply modify the control codes.
-
- Member
- Posts: 30
- Joined: Sat Feb 07, 2015 11:32 pm