Page 1 of 1

i want to add sensors

Posted: Mon Apr 06, 2015 8:00 am
by Sahildeep
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

Re: i want to add sensors

Posted: Tue Apr 07, 2015 9:42 am
by arnaud
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.

Re: i want to add sensors

Posted: Tue Apr 07, 2015 4:32 pm
by Greensprings