Arduboat and dynamic route planning

Hello,
I am currently working on an autonomous boat control system running on a Raspberry Pi 3 (Arch linux) taking care of obstacle avoidance and path planning, combining weather, geographical and AIS data. The software takes a waypoints list as a general route to follow and then places intermediate waypoints according to data coming in real time, in order to avoid a storm, an obstacle or the shoreline.

Now, I was wondering if a PixHawk or similar board running ArduBoat could be a good companion hardware to manage navigation and motor/rudder control.
Since ArduBoat relies on a predefined waypoint list, ideally a possible workaround would be to have the Raspberry calculate the path and push intermediate waypoints to the PixHawk, which will then steer the boat accordingly.

Is it doable or should I look for another autopilot platform?
Thank you

Yes, you can use ArduPilot (Rover variant)

do you suggest to use a PixHawk or a PXFmini (to keep the same hardware)?

I’m a bit biased towards the Navio2 ;), check Emlid tutorials :slight_smile: https://docs.emlid.com/navio2/

but any ArduPilot compatible hardware should do what you want.

I see, however first using a separate hardware running a RTOS the whole system would be more reliable in case of a linux crash, then for price reasons a PixHawk, PXFmini or a Pixracer seem more suitable (I’m still in the testing phase).

Sure, any options are viable. That’s the beauty of the ArduPilot ecosystem :slight_smile:

FYI, the Emlid distribution of Debian Reach has already been tweaked to behave like a RTOS.

I use frequently both solutions. Navio2 alone, and PixHawk/PixRacer + Companion Computer (RPI/XU4/others)

Can I use CanBus instead of MavLink to connect the Raspberry to the autopilot?

Mavlink is a protocol that is not used on top of Canbus, which I believe also requires special hardware on the RPI

I would prefer to use the industry-standard CAN protocol if supported

Rene,

I guess you’ve seen the companion computer section on the wiki? Hopefully this is a good starting point. As mentioned above, the connection between companion computer and the flight controller needs to be a serial connection for now (using the mavlink protocol). when ArduPilot is in Guided mode it accepts real-time navigation requests from the companion computer so that’s also an option instead of constantly updating the mission.

rmackay
where can i find information about “the real time navigation requests from the companion computer” ?
I need to implement a follow me mode on a rover/boat.
I would like to know if there is already a funcion that implement the follow me. I studied the ardurover control mode wiki and at guided mode section there are only information about the waypoint setting with the mouse ( http://ardupilot.org/rover/docs/guided-mode.html?highlight=guided ).
thanks

I’m planning to write up a wiki page with all the commands that Rover and Copter support but until then you can see most of the messages we support by looking in the APMrover2/GCS_Mavlink.cpp file. In particular have a look at the handleMessage() method.

The two best options for follow me are probably:

I think the lower option is better. It’s more consistent with how we control other vehicles.

Thnks for the link.
I studied the GSC_Mavlink.cpp and I have understdand that the messages
#82 case MAVLINK_MSG_ID_SET_ATTITUDE_TARGET
#82 case MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED
#86 case MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT
are dedicated for the guided mode
( // exit if vehicle is not in Guided mode
if (rover.control_mode != &rover.mode_guided) {
break;
} )
but I can’t understand how to compile this messages.
I also found the method
GCS_MAVLINK_Rover::handle_guided_request(AP_Mission::Mission_Command &cmd)
for the upload of the waypoint but I don’t understand the argument of
rover.mode_guided.set_desired_location(cmd.content.location);
where are defined the cmd?

Hi Ru,

I think it’s better to use the set-position-target-global-int message rather the mission-command-int. We are deprecating the mission-command-int message method at some point.

The set-position-target-global-int method should work if you can figure out how to send the message from your ground station or companion computer. the tricky thing about this message is just getting the type-mask field correct.

If I understand you are saying that we can use only the messages
#82 SET_ATTITUDE_TARGET
#86 SET_POSITION_TARGET_GLOBAL_INT
to implement the follow mode. Is it correct?

I have one other question. I’m studying the #86 message but I can’t find the definition of the packet that contains the informations. In particular I’m referring to this lines

// decode packet
mavlink_set_position_target_global_int_t packet;

can you say me where I can find mavlink_set_position_target_global_int_t?

thanks a lot