Hello, I am trying to understand the basic offboard example in px4_ros_com. I have manage to run it, but I can not understad why in offboard_control.py in engage_offboard_mode at 67 line, the command to switch in offboard mode is set as
self.publish_vehicle_command(
VehicleCommand.VEHICLE_CMD_DO_SET_MODE, param1=1.0, param2=6.0)
self.get_logger().info("Switching to offboard mode")
I have found that inside the px4_custom_mode.h in the firmware offboard mode is defined as the following at line 137
case vehicle_status_s::NAVIGATION_STATE_OFFBOARD:
custom_mode.main_mode = PX4_CUSTOM_MAIN_MODE_OFFBOARD;
break;
So why param1 is 1.0 instead of 0.0 if a custom_mode.sub_mode
is not defined?