Use IO-s for steering

Hi,

I’m interested in using APM 2.5 IO-s for steering my rover from obstacles. Idea is to use a second controller like Arduino Nano that can handle all the sensors and just send signals when something is in the way of the rover. I want to use multiple sensors but as I understand rover can manage currently only 2 ultrasonic sensors. I want to use array of low cost ultrasonic sensors and maybe some IR sensors.

How can I connect these IO-s ? How to activate it? Can I use the current firmware or do I need to change it. Should I use Python scripts or how?

Thanks In Advance,
Raimo

@Riff_,
Presently the APM is set up to accept distance sensor inputs that provide a voltage that is proportional to the distance sensed and to take evasive action on it own. The trigger distance, turn angle, and time of turn can be programmed using the MP.
I have two Maxbotix MB1240 sonar sensors on A0 and A1 with sequential triggers on A2 and A3. They work fine at avoid obstacles.
I have also setup a rover where the APM steering and throttle outputs are sent to an Arduino Uno which has three forward facing ultrasonic sensors and two rear facing IR sensors. If there are no objects in the rovers path the APM navigation signals are passed through to the steering and throttle control on the rover. If an object is detected by the Arduino, then it takes control and takes evasive action to avoid the obstacle and then goes back to passing through the APM steering and throttle commands to the rover.
If you want a custom obstacle avoidance function, then you will have to do the programming yourself.
Regards,
TCIII Developer

Hi,

Is it possible for you to send your code so I can study it?
Uno and Nano are almost identical…

Thanks,
Raimo

@Riff_
It has been a long time since I used that code. I will see what I can do to find it. I used a modified version of the code from the MINDS-I Arduino code library: http://www.mymindsi.com/code. I essentially combined their R/C receiver control code and object avoidance code and used the output of the APM as the R/C steering and throttle inputs to the Arduino. The Arduino outputs went to the rover servo and ESC.
Regards,
TCIII Developer

1 Like

TCIII, That is clever. That code would be the glue to what I am trying to develop. Were you able to locate that code and are you willing to share. I would save many evenings of struggle.

@urthlight,
Have you been to the mindsi.com website to look at their Arduino code downloads?
I have basically outlined my approach. However I am not a really good Arduino programmer. It was basically cut and try until there were no compiler errors.
Regard,
TCIII AVD

It appears I am much like you. I did go and get the files and am preparing to dive in. I was just hoping for a shortcut.

@urthlight,
It is the only way that you are going to learn to splice the necessary programs together to get the functionality that you require.
I have looked at my Minds-I program folder and all I have in it is the original Minds-I programs that I started with to get the necessary functionality that I required. I know that the final program I created was in a Sketch file, but darn if I can find it again.
Regards,
TCIII GM

Yup, Well thanks anyway.