Hi guys, im using this type of sensor. Thankfully i able to work using my ardupilot mega(apm). I be able to find out which pin can be used for this sensors. I need to adds on my project.
I would like to know how to move the motor. So that when the my quadcopter is the air, the sensor enable help the quadcopter for obstacle avoidance. When one of the sensor is near to avoidance, one of the motor will move the higher speed so that is move away from avoidance or wall.
Is there code for this programe? Or any code like move the motor?
Replies
In stead of moving the motor directly, you should probably adjust the roll or pitch appropriately. Then let the attitude control take care of firing the motors appropriately to achieve the required roll or pitch.
Jose did this originally a long long time ago on his mini quads using the same sensor (I think) as you're using. I then integrated the code into arducopterNG but it's not in ACM but will likely be addedback at some point in the future.
You might be able to tack in a short segment that will modify the angle setpoint for the attitude PID whenever the sensor goes high.
But as far as getting the quad to remember the obstical is there, that's a little more into the AI realm of programming.