px4-offboard icon indicating copy to clipboard operation
px4-offboard copied to clipboard

Add a new c++ node offboard example

Open Ecuashungo opened this issue 2 years ago • 6 comments

I have moved all python-related content to a separate package and created a parallel c++-package. Instructions on how to use it are in a nested README.md

Ecuashungo avatar Nov 18 '22 11:11 Ecuashungo

@Jaeyoung-Lim thanks for the review, glad I can contribute to the PX4 community.

What do you suggest with respect to the naming and directory structure?

What would be the advantage of merging both the python node and the c++ node into the same package? With the packages separated, a user could add a COLCON_IGNORE file to one package to just use the other one, which is why I have implemented it in this way.

One other thought: One thing that would be nice to add at some point is the same RVIZ functionality that you have for the python code.

Ecuashungo avatar Nov 22 '22 11:11 Ecuashungo

Hello and thanks for your contribution,

I tested the cpp version and faced the issue you mentioned in the Troubleshooting part of the ReadMe : the offboard control mode won't be applied to the SITL version of PX4. If I use the commander mode offboard to switch to offboard control mode, it works very fine. Do you have any clue on what is the problem with the VEHICLE_CMD_DO_SET_MODE ?

TheotimeBalaguer avatar Dec 06 '22 16:12 TheotimeBalaguer

Do you have any clue on what is the problem with the VEHICLE_CMD_DO_SET_MODE ?

@TheotimeBalaguer There should be no problem with sending a switch mode command with mavlink. How are you sending this mavlink command?

Jaeyoung-Lim avatar Dec 06 '22 16:12 Jaeyoung-Lim

How are you sending this mavlink command?

I am using this function, which send an OffboardControlMode with only the position flag on true.

TheotimeBalaguer avatar Dec 06 '22 16:12 TheotimeBalaguer

@TheotimeBalaguer That is not related to VEHICLE_CMD_DO_SET_MODE. VEHICLE_CMD_DO_SET_MODE is a mavlink message

Jaeyoung-Lim avatar Dec 06 '22 16:12 Jaeyoung-Lim

You are right my bad ! I guess it has something to do with px4_msgs::msg::OffboardControlModenot working as expected. I'll have a look today.

TheotimeBalaguer avatar Dec 07 '22 07:12 TheotimeBalaguer