Jaeyoung-Lim / px4-offboard

Example of PX4 offboard control over microdds using python ROS 2
BSD 3-Clause "New" or "Revised" License
120 stars 52 forks source link

Add a new c++ node offboard example #7

Open Ecuashungo opened 1 year ago

Ecuashungo commented 1 year ago

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 commented 1 year ago

@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.

TheotimeBalaguer commented 1 year ago

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 ?

Jaeyoung-Lim commented 1 year ago

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?

TheotimeBalaguer commented 1 year ago

How are you sending this mavlink command?

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

Jaeyoung-Lim commented 1 year ago

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

TheotimeBalaguer commented 1 year ago

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.