i want to add sensors

Discussions about all things Bitcraze
Post Reply
Sahildeep
Beginner
Posts: 7
Joined: Tue Mar 24, 2015 4:43 am

i want to add sensors

Post 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
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: i want to add sensors

Post 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.
Greensprings
Member
Posts: 30
Joined: Sat Feb 07, 2015 11:32 pm

Re: i want to add sensors

Post by Greensprings »

Post Reply