Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DVu2
Beginner
3,245 Views

How to enable offboard mode?

Jump to solution

Hi,

We want to enable "OFFBOARD" mode and write an application on the Aero Computation to autonomously fly the drone.

We have tried to follow the instruction shown at https://dev.px4.io/en/ros/offboard_control.html consisting 2 steps:

1. mapping an RC switch to activate Offboard mode, we chose channel 5, which is the flight mode switch.

2. enabling the companion computer interface. We tried to set both values (921600and 57600) but whenever we rebooted the drone it went back to the default value.

Excepting the above method, is there any other way to enable the mode?

Thanks

0 Kudos
1 Solution
idata
Community Manager
630 Views

Hi guys,

 

 

This question can be better answered by the dronekit developers. There is a sample on to set offboard mode using plane mavlink. Follow this link https://github.com/zehortigoza/mavlink-router/commits/offboard-mode.

 

 

Regards,

 

Pablo M.

 

View solution in original post

11 Replies
idata
Community Manager
630 Views

Hi Duy,

 

 

Well, the same steps that you're using right now mention that the first step is not mandatory, "although this step isn't mandatory since you can activate offboard mode using a MAVLink message. We consider this method much safer". So that's something you could try, here's a link on how to create MAVLink messages http://qgroundcontrol.org/mavlink/create_new_mavlink_message http://qgroundcontrol.org/mavlink/create_new_mavlink_message, in case you're not aware how to do it.

 

However, it is also implied that this other method might not be that safe, so using it is at your own risk.

 

 

Regards,

 

Pablo M.
DVu2
Beginner
630 Views

Hi,

We have tried to set the "OFFBOARD" mode by Mavlink via dronekit-python (see the code below) and qGroundController.

However, none of these methods work. Do you have any detail instruction to set the mode?

code:

connection_string = "tcp:192.168.8.1:5760"

print("Connecting to vehicle on: %s" % (connection_string))

vehicle = connect(connection_string, wait_ready=False)

vehicle.mode = VehicleMode("OFFBOARD")

time.sleep(1)

print " Mode: %s" % vehicle.mode.name # have never return "OFFBOARD"

idata
Community Manager
630 Views

Hi Duy,

 

 

Let me do some more research, hopefully I will find some useful information to help you set the offboard mode on your flight controller. Will get back to you as soon as I have updates.

 

 

Regards,

 

Pablo M.
DVu2
Beginner
630 Views

Hi Pablo,

Did you find anything?

idata
Community Manager
630 Views

Hi Duy,

 

 

We are still investigating, as soon as we have updates we will post them here.

 

 

Regards,

 

Pablo M.
IMcAr
Novice
630 Views

Hi Pablo,

I have recently encountered the same problem when attempting to switch my Aero to OFFBOARDmode. I believe I followed all steps correctly however my GC station prints a reject OFFBOARD mode message every time I attempt to take off. Any work arounds yet?

Thanks,

Ian

idata
Community Manager
630 Views

Hi Ian,

 

 

Thank you for sharing your issue too. We'll update once we have some news on this issue.

 

 

Regards,

 

Pablo M.
BHU6
Beginner
630 Views

Hi guys,

I have the same problem.

I think the RTF doesn't support "offboard" and "guided" mode.

So, my program doesn't work well to control the RTF.

It doesn't move to target according my code.

idata
Community Manager
631 Views

Hi guys,

 

 

This question can be better answered by the dronekit developers. There is a sample on to set offboard mode using plane mavlink. Follow this link https://github.com/zehortigoza/mavlink-router/commits/offboard-mode.

 

 

Regards,

 

Pablo M.

 

View solution in original post

DVu2
Beginner
630 Views

Hi Pablo,

Thank you for your reply.

I have read the example carefully but I cannot figure out the meaning of the below assignment:

set_position.coordinate_frame = MAV_FRAME_LOCAL_OFFSET_NED;

I also have checked the Mavlink messages site (http://mavlink.org/messages/common MAVLINK Common Messages) but it does not help at all.

Could you please explain it to me?

Thanks,

Duy Vu

Lucas_M_Intel
Employee
630 Views

That is the frame of reference. By "local offset" it means that the values you pass are relative to the current position. This doesn't affect if you are giving the control as velocities, that take the NED frame of reference (there are other options to change this).

The ardupilot doc explains the frames a little bit better than the mavlink doc: http://ardupilot.org/dev/docs/copter-commands-in-guided-mode.html# set-position-target-local-ned Copter Commands in Guided Mode — Dev documentation

On this topic you'd probably get faster answers talking directly to the open source community at discuss.px4.io (for PX4 flight stack) or discuss.ardupilot.org (for ardupilot).

Reply