PX4-micrortps arm, takeoff and land

Hello,

I’m trying to control a drone using the micrortps_bridge with ROS 2.

As far as I understood, these are the topics that I can subscribe or publish

Subscribe:

            battery_status:
            adc_report:
            air_speed:
            cpu_load:
            distance_sensor:
            estimator_status:
            home_position:
            iridiumsbd_status:
            radio_status:
            satellite_info:
            sensor_baro:
            sensor_combined:
            sensor_selection:
            vehicle_attitude:
            vehicle_odometry:
            vtol_vehicle_status:
            wind_estimate:
            collision_constraints:

publish:

            camera_capture
            camera_trigger
            collision_report
            debug_array
            debug_key_value
            debug_value
            debug_vect:
            obstacle_distance
            optical_flow
            position_setpoint:
            position_setpoint_triplet
            trajectory_waypoint
            vehicle_trajectory_waypoint
            vehicle_mocap_odometry
            vehicle_visual_odometry

I’m able to subscribe the different topics (some of them are not sending data). Also I’m able to publish some data, I checked this using px4-listener with the topic debug_vect.

The questions is:

How I should configure the drone or in which topic should I need to publish to be able to arm, takeoff and/or land?

Right now I’m trying to publish data in the topic position_setpoint setting the following:

uint8 SETPOINT_TYPE_TAKEOFF=3	# takeoff setpoint

valid = true
type = SETPOINT_TYPE_TAKEOFF

Thanks

@TSC21 Sorry for mentioning you, Nuno, But I have seen that you are working with ros_px4_com, maybe you can give me some insights.

Thanks in advance

Hello,

I found out a solution. I had a deeper look in the code and the structure of the code. I found that the file uorb_rtps_message_ids.yaml contains details about the topics that are going to be published or subscribed. I have included vehicle_command as a received topic and recompiled PX4. Right now I’m able to arm, takeoff, land and move the drone to a specific goal.

Is it the right approach? or I need to publish in other topic?

Regards

1 Like

Hi @ahcorde!

My drone is switched to offboard mode, armed and mavlink_log states “Takeoff Detected”. However the drone is not taking off. I am publishing on PositionSetpointTriplet topic. How did you manage to make it take off through fast-RTPS?

Cheers!