first of all I started the micrortps_agent with ttyACM0 and get the output:
~$ micrortps_agent -t UARt -d /dev/ttyACM0 -b 921600
--- MicroRTPS Agent ---
[ micrortps_agent ] Starting link...
[ micrortps_agent ] UART transport: device: /dev/ttyACM0; baudrate: 921600; poll: 1ms; flow_control: No
--- Subscribers ---
- DebugArray subscriber started
- DebugKeyValue subscriber started
- DebugValue subscriber started
- DebugVect subscriber started
- OffboardControlMode subscriber started
- OpticalFlow subscriber started
- PositionSetpoint subscriber started
- PositionSetpointTriplet subscriber started
- TelemetryStatus subscriber started
- Timesync subscriber started
- VehicleCommand subscriber started
- VehicleLocalPositionSetpoint subscriber started
- VehicleTrajectoryWaypoint subscriber started
- OnboardComputerStatus subscriber started
- TrajectoryBezier subscriber started
- VehicleTrajectoryBezier subscriber started
- TrajectorySetpoint subscriber started
- VehicleMocapOdometry subscriber started
- VehicleVisualOdometry subscriber started
-----------------------
---- Publishers ----
- Timesync publishers started
- TrajectoryWaypoint publisher started
- VehicleControlMode publisher started
- VehicleOdometry publisher started
- VehicleStatus publisher started
- CollisionConstraints publisher started
- TimesyncStatus publisher started
- SensorCombined publisher started
- VehicleTrajectoryWaypointDesired publisher started
-----------------------
then I started nsh terminal ( px4 side in other term) with my UART to USB converter (CP2102) then entered the terminal:
~/PX4-Autopilot/Tools$ ./mavlink_shell.py /dev/ttyUSB0
Connecting to MAVLINK...
nsh>
then to see ros2 side topic list:
~$ ros2 topic list
/fmu/collision_constraints/out
/fmu/debug_array/in
/fmu/debug_key_value/in
/fmu/debug_value/in
/fmu/debug_vect/in
/fmu/offboard_control_mode/in
/fmu/onboard_computer_status/in
/fmu/optical_flow/in
/fmu/position_setpoint/in
/fmu/position_setpoint_triplet/in
/fmu/sensor_combined/out
/fmu/telemetry_status/in
/fmu/timesync/in
/fmu/timesync/out
/fmu/trajectory_bezier/in
/fmu/trajectory_setpoint/in
/fmu/trajectory_waypoint/out
/fmu/vehicle_command/in
/fmu/vehicle_control_mode/out
/fmu/vehicle_local_position_setpoint/in
/fmu/vehicle_mocap_odometry/in
/fmu/vehicle_odometry/out
/fmu/vehicle_status/out
/fmu/vehicle_trajectory_bezier/in
/fmu/vehicle_trajectory_waypoint/in
/fmu/vehicle_trajectory_waypoint_desired/out
/fmu/vehicle_visual_odometry/in
/parameter_events
/rosout
/timesync_statusc
but first question came here into my mind. I am using different controller which is Holybro Durandal. But all of the topics for fmu based, in that case will I have any trouble with that , I don’t have any idea.
I passed to echo respectively, but I saw only …/out topics can be matched, WHY?
,and in every echo command I opened seperate terminal page and I commanded all the topics which are ending with /out ( because I could only echo these ones.)
~$ ros2 topic echo /fmu/sensor_combined/out
~$ ros2 topic echo /fmu/collision_constraints/out
~$ ros2 topic echo /fmu/timesync/out
~$ ros2 topic echo /fmu/trajectory_waypoint/out
~$ ros2 topic echo /fmu/vehicle_control_mode/out
~$ ros2 topic echo /fmu/vehicle_odometry/out
~$ ros2 topic echo /fmu/vehicle_status/out
~$ ros2 topic echo /fmu/vehicle_trajectory_waypoint_desired/out
And these commands wait for forever nothing happend in every terminal that is run. Is there something has to appear, I dunno, If doesn’t please let me know. I am diving all the details I guess.
Then in micrortps_agent side all the matches has been happened.
~$ micrortps_agent -t UARt -d /dev/ttyACM0 -b 921600
--- MicroRTPS Agent ---
[ micrortps_agent ] Starting link...
[ micrortps_agent ] UART transport: device: /dev/ttyACM0; baudrate: 921600; poll: 1ms; flow_control: No
--- Subscribers ---
- DebugArray subscriber started
- DebugKeyValue subscriber started
- DebugValue subscriber started
- DebugVect subscriber started
- OffboardControlMode subscriber started
- OpticalFlow subscriber started
- PositionSetpoint subscriber started
- PositionSetpointTriplet subscriber started
- TelemetryStatus subscriber started
- Timesync subscriber started
- VehicleCommand subscriber started
- VehicleLocalPositionSetpoint subscriber started
- VehicleTrajectoryWaypoint subscriber started
- OnboardComputerStatus subscriber started
- TrajectoryBezier subscriber started
- VehicleTrajectoryBezier subscriber started
- TrajectorySetpoint subscriber started
- VehicleMocapOdometry subscriber started
- VehicleVisualOdometry subscriber started
-----------------------
---- Publishers ----
- Timesync publishers started
- TrajectoryWaypoint publisher started
- VehicleControlMode publisher started
- VehicleOdometry publisher started
- VehicleStatus publisher started
- CollisionConstraints publisher started
- TimesyncStatus publisher started
- SensorCombined publisher started
- VehicleTrajectoryWaypointDesired publisher started
-----------------------
[ micrortps_agent ] VehicleOdometry publisher matched
[ micrortps_agent ] VehicleOdometry publisher unmatched
[ micrortps_agent ] CollisionConstraints publisher matched
[ micrortps_agent ] SensorCombined publisher matched
[ micrortps_agent ] Timesync publisher matched
[ micrortps_agent ] TrajectoryWaypoint publisher matched
[ micrortps_agent ] VehicleControlMode publisher matched
[ micrortps_agent ] VehicleOdometry publisher matched
[ micrortps_agent ] VehicleStatus publisher matched
[ micrortps_agent ] VehicleTrajectoryWaypointDesired publisher matched
then in nsh terminal to see UORB topics I command ls /obj then the output that I got:
nsh> ls /obj
/obj:
actuator_armed0
actuator_controls_00
actuator_controls_10
actuator_controls_virtual_fw0
actuator_controls_virtual_mc0
actuator_outputs0
actuator_outputs1
adc_report0
airspeed_validated0
airspeed_wind0
battery_status0
commander_state0
cpuload0
ekf2_timestamps0
ekf2_timestamps1
ekf_gps_drift0
ekf_gps_drift1
esc_status0
estimator_attitude0
estimator_attitude1
estimator_event_flags0
estimator_event_flags1
estimator_global_position0
estimator_global_position1
estimator_innovation_test_ratios0
estimator_innovation_test_ratios1
estimator_innovation_variances0
estimator_innovation_variances1
estimator_innovations0
estimator_innovations1
estimator_local_position0
estimator_local_position1
estimator_odometry0
estimator_odometry1
estimator_optical_flow_vel0
estimator_optical_flow_vel1
estimator_selector_status0
estimator_sensor_bias0
estimator_sensor_bias1
estimator_states0
estimator_states1
estimator_status0
estimator_status1
estimator_status_flags0
estimator_status_flags1
estimator_wind0
estimator_wind1
input_rc0
led_control0
log_message0
mavlink_log0
mc_virtual_attitude_setpoint0
mission0
multirotor_motor_limits0
parameter_update0
position_controller_landing_status0
position_setpoint_triplet0
px4io_status0
rate_ctrl_status0
rate_ctrl_status1
safety0
sensor_accel0
sensor_accel1
sensor_accel_fifo0
sensor_accel_fifo1
sensor_baro0
sensor_combined0
sensor_gps0
sensor_gyro0
sensor_gyro1
sensor_gyro_fft0
sensor_gyro_fifo0
sensor_gyro_fifo1
sensor_mag0
sensor_preflight_mag0
sensor_selection0
sensors_status_imu0
system_power0
takeoff_status0
task_stack_info0
telemetry_status0
telemetry_status1
test_motor0
tune_control0
vehicle_acceleration0
vehicle_air_data0
vehicle_angular_acceleration0
vehicle_angular_velocity0
vehicle_attitude0
vehicle_attitude_setpoint0
vehicle_command0
vehicle_command_ack0
vehicle_control_mode0
vehicle_imu0
vehicle_imu1
vehicle_imu_status0
vehicle_imu_status1
vehicle_land_detected0
vehicle_local_position0
vehicle_magnetometer0
vehicle_odometry0
vehicle_rates_setpoint0
vehicle_status0
vehicle_status_flags0
vtol_vehicle_status0
yaw_estimator_status0
yaw_estimator_status1
I tried to see most of them but I didn’t some of the calibrations yet.
nsh> listener vehicle_imu
TOPIC: vehicle_imu 2 instances
Instance 0:
vehicle_imu_s
timestamp: 27204797735 (0.010679 seconds ago)
timestamp_sample: 27204797281 (454 us before timestamp)
accel_device_id: 3932170 (Type: 0x3C, SPI:1 (0x00))
gyro_device_id: 3932170 (Type: 0x3C, SPI:1 (0x00))
delta_angle: [0.0000, 0.0000, -0.0000]
delta_velocity: [0.0021, -0.0002, -0.0484]
delta_angle_dt: 5003
delta_velocity_dt: 5003
delta_velocity_clipping: 0
calibration_count: 10
Instance 1:
vehicle_imu_s
timestamp: 27204865317 (0.003154 seconds ago)
timestamp_sample: 27204865230 (87 us before timestamp)
accel_device_id: 6946826 (Type: 0x6A, SPI:1 (0x00))
gyro_device_id: 6684682 (Type: 0x66, SPI:1 (0x00))
delta_angle: [-0.0000, -0.0000, -0.0000]
delta_velocity: [0.0023, 0.0002, -0.0483]
delta_angle_dt: 5005
delta_velocity_dt: 4997
delta_velocity_clipping: 0
calibration_count: 8
nsh> listener vehicle_local_position
TOPIC: vehicle_local_position
vehicle_local_position_s
timestamp: 27236966608 (0.003855 seconds ago)
timestamp_sample: 27236965912 (696 us before timestamp)
ref_timestamp: 0
ref_lat: nan
ref_lon: nan
x: 0.0030
y: -0.0022
z: -1.3499
delta_xy: [0.0000, 0.0000]
delta_z: 0.0000
vx: 0.0027
vy: -0.0035
vz: 0.0010
z_deriv: 0.0075
delta_vxy: [-0.0001, 0.0001]
delta_vz: 0.0000
ax: 0.0270
ay: -0.0386
az: 0.0300
heading: -0.5254
delta_heading: -0.0022
ref_alt: nan
dist_bottom: 0.1000
eph: 0.0811
epv: 0.5319
evh: 0.0916
evv: 0.1465
vxy_max: inf
vz_max: inf
hagl_min: inf
hagl_max: inf
xy_valid: False
z_valid: True
v_xy_valid: False
v_z_valid: True
xy_reset_counter: 1
z_reset_counter: 0
vxy_reset_counter: 1
vz_reset_counter: 0
heading_reset_counter: 2
xy_global: False
z_global: False
dist_bottom_valid: True
dist_bottom_sensor_bitfield: 0
nsh> listener vehicle_status
TOPIC: vehicle_status
vehicle_status_s
timestamp: 27280718351 (0.117449 seconds ago)
nav_state_timestamp: 1155088
failsafe_timestamp: 0
armed_time: 0
takeoff_time: 0
onboard_control_sensors_present: 304119868
onboard_control_sensors_enabled: 304185372
onboard_control_sensors_health: 2523151
nav_state: 0
arming_state: 1
hil_state: 0
failsafe: False
system_type: 22
system_id: 1
component_id: 1
vehicle_type: 1
is_vtol: True
is_vtol_tailsitter: False
vtol_fw_permanent_stab: False
in_transition_mode: False
in_transition_to_fw: False
rc_signal_lost: True
rc_input_mode: 0
data_link_lost: True
data_link_lost_counter: 0
high_latency_data_link_lost: False
engine_failure: False
mission_failure: False
geofence_violated: False
failure_detector_status: 0
latest_arming_reason: 0
latest_disarming_reason: 0
nsh> listener vehicle_rates_setpoint
TOPIC: vehicle_rates_setpoint
vehicle_rates_setpoint_s
timestamp: 27305331033 (0.006427 seconds ago)
roll: -0.0069
pitch: -0.2866
yaw: 0.0001
thrust_body: [0.0000, 0.0000, -0.0000]
some of the topics gave me the never published, I don’t know why, where is the problem:
nsh> listener sensor_gps
never published
then I command this one also:
nsh> listener sensor_combined
TOPIC: sensor_combined
sensor_combined_s
timestamp: 29324036401 (0.004735 seconds ago)
gyro_rad: [-0.0009, 0.0016, -0.0010]
gyro_integral_dt: 5003
accelerometer_timestamp_relative: 0
accelerometer_m_s2: [0.4562, -0.0430, -9.6767]
accelerometer_integral_dt: 5003
accelerometer_clipping: 0
I run this code in ros2 side:
~$ ros2 topic pub /fmu/sensor_combined/out px4_msgs/msg/SensorCombined
publisher: beginning loop
publishing #1: px4_msgs.msg.SensorCombined(timestamp=0, gyro_rad=array([0., 0., 0.], dtype=float32), gyro_integral_dt=0, accelerometer_timestamp_relative=0, accelerometer_m_s2=array([0., 0., 0.], dtype=float32), accelerometer_integral_dt=0, accelerometer_clipping=0)
publishing #2: px4_msgs.msg.SensorCombined(timestamp=0, gyro_rad=array([0., 0., 0.], dtype=float32), gyro_integral_dt=0, accelerometer_timestamp_relative=0, accelerometer_m_s2=array([0., 0., 0.], dtype=float32), accelerometer_integral_dt=0, accelerometer_clipping=0)
publishing #3: px4_msgs.msg.SensorCombined(timestamp=0, gyro_rad=array([0., 0., 0.], dtype=float32), gyro_integral_dt=0, accelerometer_timestamp_relative=0, accelerometer_m_s2=array([0., 0., 0.], dtype=float32), accelerometer_integral_dt=0, accelerometer_clipping=0)
I got the messages then in:
~$ ros2 topic echo /fmu/sensor_combined/out
timestamp: 0
gyro_rad:
- 0.0
- 0.0
- 0.0
gyro_integral_dt: 0
accelerometer_timestamp_relative: 0
accelerometer_m_s2:
- 0.0
- 0.0
- 0.0
accelerometer_integral_dt: 0
accelerometer_clipping: 0
---
timestamp: 0
gyro_rad:
- 0.0
- 0.0
- 0.0
gyro_integral_dt: 0
accelerometer_timestamp_relative: 0
accelerometer_m_s2:
- 0.0
- 0.0
- 0.0
accelerometer_integral_dt: 0
accelerometer_clipping: 0
---
timestamp: 0
gyro_rad:
- 0.0
- 0.0
- 0.0
gyro_integral_dt: 0
accelerometer_timestamp_relative: 0
accelerometer_m_s2:
- 0.0
- 0.0
- 0.0
accelerometer_integral_dt: 0
accelerometer_clipping: 0
---
Why is it happenning I really don’t get it… In nsh terminal I can subscribe and see the UORB but in ROS2 side I couldn’t see the datas coming from onboard sensors.Could you help me please, in this topic I wish some one help me