Using Raspberry Pi with APM 2.6 and CMOS camera


I was wondering if someone could point me in the right direction. I plan on using a APM 2.6 autopilot along with a Raspberry Pi with a CMOS camera connected for visual guidance. My main question is what is the best way to get the Pi and the autopilot to communicate with each other? Will USB work? If USB will not work is there a way to use the A pins for some type of serial communication with external devices like a UART?

Once I have them talking is it possible for the Pi to send auto guidance commands to the controller during an AUTO mission? For instance, if I send a copter to a location and was looking for a red square on the ground; if it sees a red square it should land on it; if it does not see a red square it should return to home.

If the above will not work, and it is not possible for the Pi and the autopilot to play nice with each other, Is it possible to change mission script commands while the autopilot is in a current mission? For instance, I send the copter to a location, it hovers, the Pi communicates with my ground station, and I have a program that writes commands to send to the APM over the telemetry link? I guess what I am asking is there a way to send terminal commands using something like a python script, to the autopilot over the telemetry link?

Thanks for any help.

After doing some research I found out that you cannot use the USB and Telemetry ports together. This could potentially cause a problem for me since part of my project consist of having a constant Telemetry link.

You can, you just need to bypass the mux.

See … _the_board

[quote=“billbonney”]You can, you just need to bypass the mux.

See … _the_board[/quote]

Thanks, sorry I am a total noobie. I do have programming experience but lack a bit on the Hardware side.

I read a little about this I just want to make sure I have a clear understanding. If I cut the upper bridges and bridge the bottom pads it will allow me to use the USB and the 3DR telemetry radios together? Will this disable being able to power the APM through USB for setup etc, can I still connect to my computer? Also having USB and the power plug connected will not cause an issue during operation right?

If this is the case will it then be possible to send commands from a USB connected Pi to the APM 2.6 with MAVlink? It seems you can use MAVlink to send commands to the APM 2.6. Is it possible to run interrupts during a mission then? What I am wanting to do is something like this; I plan a full mission with Mission Planner. The copter moves to the first waypoint and Loiters for 5 seconds, During this time the Pi will search for a set of colors at that waypoint. The colors would correspond to what the Copter should do next. If it sees no color it should continue to the next location. If it sees one of the command colors it should interrupt the mission and do a command. After the command has been executed it should continue with the mission. Is this possible to do without re-writing the mission list? Can I simply pass a new mission waypoint with a higher priority to the existing mission list?

Thanks again.

No one has any input on this?

There’s a lot more info on this on the forum.

It won’t disable the USB connection or stop you powering the board using USB via your computer, or cause an issue while powering using the power module and usb at the sametime.

You can connect your RPi pi using the USB cable, but I wouldn’t, since it can cause the board to reset if the USB cable is lose. Use the UART0 output pins to connect to a serial port on the RPi.

this is an example, except it is using the Pixhawk, the connections to the RPI as the same.

The trick is to not have RPi/Computer communicating at the sametime, otherwise it should work.

You could interrupt a mission by sending ‘guided’ mode commands, then go back to auto to continue the mission

Hope that helps :slight_smile:

This is really really advanced stuff, and this forum is really for support of normal users. If you want to get into this sort of thing, you should join the developer group.

This is really really advanced stuff, and this forum is really for support of normal users. If you want to get into this sort of thing, you should join the developer group.[/quote]

Hi, I have been busy lately and have not had a chance to check this recently. How do I join the developer group?

I have made the modifications to send telemetry over UART2 on the bottom of my APM 2.6. After the changes I can no longer connect via telemetry. Do I need to make any changes to the firmware? I see no mention’s of serial3 anywhere. I see serial 0-2 protocol and baud rates being set in parameters, but nothing for serial3.

Thanks again.

I made the same change after the MUX chip fried, don’t know why, but after I strapped Serial0 to the USB I tried to use Serial2 for telemetry. However, no data are appearing. I tried installing previous versions of ArduCopter but nothing. Before 3.1 I think it was, there was a baud rate setting for Serial3 (misnamed Serial2) but I still got nothing. In 3.2.1 there are settings for Serial0 and Serial1, but not for Serial2 (or 3). So I tried to install the Rover firmware, and lo and behold, data was coming out the Serial2 port. I then reinstalled the Copter firmware, and the data disappeared. Along with the settings for Serial2, Serial3, Serial4…

My conclusion is that the Copter firmware 3.2.1 does not support the third serial port, Serial2, regardless of what this page says ( … ka_serial3). So I’ll buy a new MUX chip and solder on, while the OP will have to compile his own firmware it seems. A pity.