mavros icon indicating copy to clipboard operation
mavros copied to clipboard

Unable to use ~/setpoint_raw/attitude to control attitude of drone

Open cesar-source opened this issue 4 years ago • 2 comments

This is only bug and feature tracker, please use it to report bugs or request features.


Issue details

I have been having issues in control my drone in simulation using the ~/setpoint_raw/attitude topic. I have also /mavros/setpoint_attitude/use_quaternion set to true. However, there is something odd going on as I still cannot control the attitude of the drone using quaternions, but I can with the attitude rate commands. Does anyone know why this could be happening?

To add to this, I am currently just trying to get the drone to hover in place. I have a height controller which determines throttle commands to achieve a desired height. When I send body rate commands of:

target_attitude.body_rate.x = 0.0
target_attitude.body_rate.y = 0.0
target_attitude.body_rate.z = 0.0

the drone hovers at the desired height. To do the same with the attitude commands, I send an orientation of:

target_attitude.orientation.x = 0.0
target_attitude.orientation.y = 0.0
target_attitude.orientation.z = 0.0
target_attitude.orientation.w = 1.0

This should give me 0 rotation? I also should mention that I am changing the type_mask from 128 (ignore orientation) to 7 (ignore body rates) when performing these runs.

Finally, when I run rostopic echo setpoint_raw/target_attitude I never actually see the typemask change to 7. However, when the typemask is changed to 128 to ignore the orientation field, the messages stop coming in altogether BUT the drone is able to hover at the desired height. What is happening here? I set the typemask by target_attitude.type_mask = 1|2|4 or target_attitude.type_mask = 128.

MAVROS version and platform

Mavros: 0.18.6 ROS: Melodic Ubuntu: 18.04

Autopilot type and version

[ ] ArduPilot [ X ] PX4

Version: 3.7.1

Node logs

started roslaunch server http://cesar:44333/

SUMMARY
========

CLEAR PARAMETERS
 * /mavros/

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /mavros/cmd/use_comp_id_system_control: False
 * /mavros/conn/heartbeat_rate: 1.0
 * /mavros/conn/system_time_rate: 1.0
 * /mavros/conn/timeout: 10.0
 * /mavros/conn/timesync_rate: 10.0
 * /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar
 * /mavros/distance_sensor/hrlv_ez4_pub/id: 0
 * /mavros/distance_sensor/hrlv_ez4_pub/orientation: PITCH_270
 * /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1
 * /mavros/distance_sensor/laser_1_sub/id: 3
 * /mavros/distance_sensor/laser_1_sub/orientation: PITCH_270
 * /mavros/distance_sensor/laser_1_sub/subscriber: True
 * /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0
 * /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser
 * /mavros/distance_sensor/lidarlite_pub/id: 1
 * /mavros/distance_sensor/lidarlite_pub/orientation: PITCH_270
 * /mavros/distance_sensor/lidarlite_pub/send_tf: True
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1
 * /mavros/distance_sensor/sonar_1_sub/horizontal_fov_ratio: 1.0
 * /mavros/distance_sensor/sonar_1_sub/id: 2
 * /mavros/distance_sensor/sonar_1_sub/orientation: PITCH_270
 * /mavros/distance_sensor/sonar_1_sub/subscriber: True
 * /mavros/distance_sensor/sonar_1_sub/vertical_fov_ratio: 1.0
 * /mavros/fake_gps/eph: 2.0
 * /mavros/fake_gps/epv: 2.0
 * /mavros/fake_gps/fix_type: 3
 * /mavros/fake_gps/geo_origin/alt: 408.0
 * /mavros/fake_gps/geo_origin/lat: 47.3667
 * /mavros/fake_gps/geo_origin/lon: 8.55
 * /mavros/fake_gps/gps_rate: 5.0
 * /mavros/fake_gps/mocap_transform: True
 * /mavros/fake_gps/satellites_visible: 5
 * /mavros/fake_gps/tf/child_frame_id: fix
 * /mavros/fake_gps/tf/frame_id: map
 * /mavros/fake_gps/tf/listen: False
 * /mavros/fake_gps/tf/rate_limit: 10.0
 * /mavros/fake_gps/tf/send: False
 * /mavros/fake_gps/use_mocap: True
 * /mavros/fake_gps/use_vision: False
 * /mavros/fcu_protocol: v2.0
 * /mavros/fcu_url: udp://:14540@loca...
 * /mavros/gcs_url: 
 * /mavros/global_position/child_frame_id: base_link
 * /mavros/global_position/frame_id: map
 * /mavros/global_position/gps_uere: 1.0
 * /mavros/global_position/rot_covariance: 99999.0
 * /mavros/global_position/tf/child_frame_id: base_link
 * /mavros/global_position/tf/frame_id: map
 * /mavros/global_position/tf/global_frame_id: earth
 * /mavros/global_position/tf/send: False
 * /mavros/global_position/use_relative_alt: True
 * /mavros/image/frame_id: px4flow
 * /mavros/imu/angular_velocity_stdev: 0.0003490659 // 0...
 * /mavros/imu/frame_id: base_link
 * /mavros/imu/linear_acceleration_stdev: 0.0003
 * /mavros/imu/magnetic_stdev: 0.0
 * /mavros/imu/orientation_stdev: 1.0
 * /mavros/landing_target/camera/fov_x: 2.0071286398
 * /mavros/landing_target/camera/fov_y: 2.0071286398
 * /mavros/landing_target/image/height: 480
 * /mavros/landing_target/image/width: 640
 * /mavros/landing_target/land_target_type: VISION_FIDUCIAL
 * /mavros/landing_target/listen_lt: False
 * /mavros/landing_target/mav_frame: LOCAL_NED
 * /mavros/landing_target/target_size/x: 0.3
 * /mavros/landing_target/target_size/y: 0.3
 * /mavros/landing_target/tf/child_frame_id: camera_center
 * /mavros/landing_target/tf/frame_id: landing_target
 * /mavros/landing_target/tf/listen: False
 * /mavros/landing_target/tf/rate_limit: 10.0
 * /mavros/landing_target/tf/send: True
 * /mavros/local_position/frame_id: map
 * /mavros/local_position/tf/child_frame_id: base_link
 * /mavros/local_position/tf/frame_id: map
 * /mavros/local_position/tf/send: False
 * /mavros/local_position/tf/send_fcu: False
 * /mavros/mission/pull_after_gcs: True
 * /mavros/mission/use_mission_item_int: True
 * /mavros/mocap/use_pose: True
 * /mavros/mocap/use_tf: False
 * /mavros/odometry/fcu/odom_child_id_des: base_link
 * /mavros/odometry/fcu/odom_parent_id_des: map
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.118682
 * /mavros/px4flow/ranger_max_range: 5.0
 * /mavros/px4flow/ranger_min_range: 0.3
 * /mavros/safety_area/p1/x: 1.0
 * /mavros/safety_area/p1/y: 1.0
 * /mavros/safety_area/p1/z: 1.0
 * /mavros/safety_area/p2/x: -1.0
 * /mavros/safety_area/p2/y: -1.0
 * /mavros/safety_area/p2/z: -1.0
 * /mavros/setpoint_accel/send_force: False
 * /mavros/setpoint_attitude/reverse_thrust: False
 * /mavros/setpoint_attitude/tf/child_frame_id: target_attitude
 * /mavros/setpoint_attitude/tf/frame_id: map
 * /mavros/setpoint_attitude/tf/listen: False
 * /mavros/setpoint_attitude/tf/rate_limit: 50.0
 * /mavros/setpoint_attitude/use_quaternion: True
 * /mavros/setpoint_position/mav_frame: LOCAL_NED
 * /mavros/setpoint_position/tf/child_frame_id: target_position
 * /mavros/setpoint_position/tf/frame_id: map
 * /mavros/setpoint_position/tf/listen: False
 * /mavros/setpoint_position/tf/rate_limit: 50.0
 * /mavros/setpoint_raw/thrust_scaling: 1.0
 * /mavros/setpoint_velocity/mav_frame: LOCAL_NED
 * /mavros/startup_px4_usb_quirk: True
 * /mavros/sys/disable_diag: False
 * /mavros/sys/min_voltage: 10.0
 * /mavros/target_component_id: 1
 * /mavros/target_system_id: 1
 * /mavros/tdr_radio/low_rssi: 40
 * /mavros/time/time_ref_source: fcu
 * /mavros/time/timesync_avg_alpha: 0.6
 * /mavros/time/timesync_mode: MAVLINK
 * /mavros/vibration/frame_id: base_link
 * /mavros/vision_pose/tf/child_frame_id: vision_estimate
 * /mavros/vision_pose/tf/frame_id: odom
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: True
 * /mavros/vision_speed/twist_cov: True
 * /mavros/wheel_odometry/child_frame_id: base_link
 * /mavros/wheel_odometry/count: 2
 * /mavros/wheel_odometry/frame_id: odom
 * /mavros/wheel_odometry/send_raw: True
 * /mavros/wheel_odometry/send_twist: False
 * /mavros/wheel_odometry/tf/child_frame_id: base_link
 * /mavros/wheel_odometry/tf/frame_id: odom
 * /mavros/wheel_odometry/tf/send: False
 * /mavros/wheel_odometry/use_rpm: False
 * /mavros/wheel_odometry/vel_error: 0.1
 * /mavros/wheel_odometry/wheel0/radius: 0.05
 * /mavros/wheel_odometry/wheel0/x: 0.0
 * /mavros/wheel_odometry/wheel0/y: -0.15
 * /mavros/wheel_odometry/wheel1/radius: 0.05
 * /mavros/wheel_odometry/wheel1/x: 0.0
 * /mavros/wheel_odometry/wheel1/y: 0.15
 * /rosdistro: melodic
 * /rosversion: 1.14.11
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    mavros (mavros/mavros_node)
    sitl (px4/px4)
    vehicle_spawn_cesar_7124_7044491697582476719 (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [7134]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 91ac3700-26c1-11ec-abf8-0800274d1c64
process[rosout-1]: started with pid [7145]
started core service [/rosout]
process[sitl-2]: started with pid [7153]
INFO  [px4] Creating symlink /home/cesar/Firmware/PX4-Autopilot/build/px4_sitl_default/etc -> /home/cesar/.ros/etc

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
process[gazebo-3]: started with pid [7166]
Info: found model autostart file as SYS_AUTOSTART=4000
process[vehicle_spawn_cesar_7124_7044491697582476719-4]: started with pid [7171]
INFO  [param] selected parameter default file eeprom/parameters_4000
process[mavros-5]: started with pid [7178]
INFO  [parameters] BSON document size 1558 bytes, decoded 1558 bytes
[param] Loaded: eeprom/parameters_4000
[ INFO] [1633537336.513439210]: FCU URL: udp://:14540@localhost:14557
[ INFO] [1633537336.515715130]: udp0: Bind address: 0.0.0.0:14540
[ INFO] [1633537336.515892904]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1633537336.516161541]: GCS bridge disabled
[ INFO] [1633537336.526028473]: Plugin 3dr_radio loaded
[ INFO] [1633537336.527980984]: Plugin 3dr_radio initialized
[ INFO] [1633537336.528150440]: Plugin actuator_control loaded
[ INFO] [1633537336.530364580]: Plugin actuator_control initialized
[ INFO] [1633537336.534282337]: Plugin adsb loaded
[ INFO] [1633537336.536835046]: Plugin adsb initialized
[ INFO] [1633537336.537023869]: Plugin altitude loaded
[ INFO] [1633537336.537817673]: Plugin altitude initialized
[ INFO] [1633537336.537948828]: Plugin cam_imu_sync loaded
[ INFO] [1633537336.538431337]: Plugin cam_imu_sync initialized
[ INFO] [1633537336.538574034]: Plugin command loaded
[ INFO] [1633537336.543079485]: Plugin command initialized
[ INFO] [1633537336.543258108]: Plugin companion_process_status loaded
[ INFO] [1633537336.545059978]: Plugin companion_process_status initialized
[ INFO] [1633537336.545270684]: Plugin debug_value loaded
[ INFO] [1633537336.548507749]: Plugin debug_value initialized
[ INFO] [1633537336.548595328]: Plugin distance_sensor blacklisted
[ INFO] [1633537336.548759219]: Plugin esc_status loaded
[ INFO] [1633537336.549740562]: Plugin esc_status initialized
[ INFO] [1633537336.549966248]: Plugin fake_gps loaded
[ INFO] [1633537336.558477199]: Plugin fake_gps initialized
[ INFO] [1633537336.558780505]: Plugin ftp loaded
[ INFO] [1633537336.564937365]: Plugin ftp initialized
[ INFO] [1633537336.565160977]: Plugin geofence loaded
[ INFO] [1633537336.568504730]: Plugin geofence initialized
[ INFO] [1633537336.568725000]: Plugin global_position loaded
[ INFO] [1633537336.582010942]: Plugin global_position initialized
[ INFO] [1633537336.582514437]: Plugin gps_rtk loaded
[ INFO] [1633537336.585270736]: Plugin gps_rtk initialized
[ INFO] [1633537336.585402610]: Plugin gps_status loaded
[ INFO] [1633537336.587272240]: Plugin gps_status initialized
[ INFO] [1633537336.587450916]: Plugin hil loaded
[ INFO] [1633537336.597671209]: Plugin hil initialized
[ INFO] [1633537336.597825854]: Plugin home_position loaded
[ INFO] [1633537336.600965618]: Plugin home_position initialized
[ INFO] [1633537336.601182642]: Plugin imu loaded
[ INFO] [1633537336.606185383]: Plugin imu initialized
[ INFO] [1633537336.606349498]: Plugin keyboard_command loaded
[ INFO] [1633537336.607942442]: Plugin keyboard_command initialized
[ INFO] [1633537336.608087668]: Plugin landing_target loaded
[ INFO] [1633537336.616597994]: Plugin landing_target initialized
[ INFO] [1633537336.616750945]: Plugin local_position loaded
[ INFO] [1633537336.621125499]: Plugin local_position initialized
[ INFO] [1633537336.621273682]: Plugin log_transfer loaded
[ INFO] [1633537336.623496715]: Plugin log_transfer initialized
[ INFO] [1633537336.623698671]: Plugin manual_control loaded
[ INFO] [1633537336.626190841]: Plugin manual_control initialized
[ INFO] [1633537336.626369932]: Plugin mocap_pose_estimate loaded
[ INFO] [1633537336.628840570]: Plugin mocap_pose_estimate initialized
[ INFO] [1633537336.628980211]: Plugin mount_control loaded
[ INFO] [1633537336.631406309]: Plugin mount_control initialized
[ INFO] [1633537336.631555124]: Plugin obstacle_distance loaded
[ INFO] [1633537336.633220314]: Plugin obstacle_distance initialized
[ INFO] [1633537336.633386468]: Plugin odom loaded
[ INFO] [1633537336.636315948]: Plugin odom initialized
[ INFO] [1633537336.636492256]: Plugin onboard_computer_status loaded
[ INFO] [1633537336.638052715]: Plugin onboard_computer_status initialized
[ INFO] [1633537336.638245801]: Plugin param loaded
[ INFO] [1633537336.640816460]: Plugin param initialized
[ INFO] [1633537336.640957983]: Plugin play_tune loaded
[ INFO] [1633537336.642683991]: Plugin play_tune initialized
[ INFO] [1633537336.642854301]: Plugin px4flow loaded
[ INFO] [1633537336.647578643]: Plugin px4flow initialized
[ INFO] [1633537336.647792319]: Plugin rallypoint loaded
[ INFO] [1633537336.649721471]: Plugin rallypoint initialized
[ INFO] [1633537336.649761848]: Plugin rangefinder blacklisted
[ INFO] [1633537336.649910135]: Plugin rc_io loaded
[ INFO] [1633537336.652898952]: Plugin rc_io initialized
[ INFO] [1633537336.652947005]: Plugin safety_area blacklisted
[ INFO] [1633537336.653067926]: Plugin setpoint_accel loaded
[ INFO] [1633537336.655017907]: Plugin setpoint_accel initialized
[ INFO] [1633537336.655263681]: Plugin setpoint_attitude loaded
[ INFO] [1633537336.663142629]: Plugin setpoint_attitude initialized
[ INFO] [1633537336.663321768]: Plugin setpoint_position loaded
[ INFO] [1633537336.674213835]: Plugin setpoint_position initialized
[ INFO] [1633537336.674415638]: Plugin setpoint_raw loaded
[ INFO] [1633537336.680648668]: Plugin setpoint_raw initialized
[ INFO] [1633537336.680833306]: Plugin setpoint_trajectory loaded
[ INFO] [1633537336.684779733]: Plugin setpoint_trajectory initialized
[ INFO] [1633537336.684936598]: Plugin setpoint_velocity loaded
[ INFO] [1633537336.688786981]: Plugin setpoint_velocity initialized
[ INFO] [1633537336.689103068]: Plugin sys_status loaded
[ INFO] [1633537336.701002416]: Plugin sys_status initialized
[ INFO] [1633537336.701211393]: Plugin sys_time loaded
[ INFO] [1633537336.712155585]: TM: Timesync mode: MAVLINK
[ INFO] [1633537336.713334040]: Plugin sys_time initialized
[ INFO] [1633537336.713494297]: Plugin trajectory loaded
[ INFO] [1633537336.717673622]: Plugin trajectory initialized
[ INFO] [1633537336.717837431]: Plugin vfr_hud loaded
[ INFO] [1633537336.718674523]: Plugin vfr_hud initialized
[ INFO] [1633537336.718710648]: Plugin vibration blacklisted
[ INFO] [1633537336.718822596]: Plugin vision_pose_estimate loaded
[ INFO] [1633537336.723671505]: Plugin vision_pose_estimate initialized
[ INFO] [1633537336.723872981]: Plugin vision_speed_estimate loaded
[ INFO] [1633537336.726151051]: Plugin vision_speed_estimate initialized
[ INFO] [1633537336.726323066]: Plugin waypoint loaded
[ INFO] [1633537336.730586570]: Plugin waypoint initialized
[ INFO] [1633537336.730656177]: Plugin wheel_odometry blacklisted
[ INFO] [1633537336.730792840]: Plugin wind_estimation loaded
[ INFO] [1633537336.731449449]: Plugin wind_estimation initialized
[ INFO] [1633537336.731511942]: Autostarting mavlink via USB on PX4
[ INFO] [1633537336.731654171]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1633537336.731840135]: Built-in MAVLink package version: 2021.3.3
[ INFO] [1633537336.731864841]: Known MAVLink dialects: common ardupilotmega ASLUAV all autoquad icarous matrixpilot paparazzi standard uAvionix ualberta
[ INFO] [1633537336.731890440]: MAVROS started. MY ID 1.240, TARGET ID 1.1
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
PX4 SIM HOST: localhost
INFO  [simulator] Waiting for simulator to accept connection on TCP port 4560
[ INFO] [1633537337.020784744]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1633537337.023046827]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[INFO] [1633537337.362050, 0.000000]: Loading model XML from file /home/cesar/Firmware/PX4-Autopilot/Tools/sitl_gazebo/models/spiri/spiri.sdf
[INFO] [1633537337.368941, 0.000000]: Waiting for service /gazebo/spawn_sdf_model
[ INFO] [1633537337.541329585]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1633537337.576236010, 0.028000000]: Physics dynamic reconfigure ready.
[INFO] [1633537337.673184, 0.124000]: Calling service /gazebo/spawn_sdf_model
[INFO] [1633537337.823614, 0.152000]: Spawn status: SpawnModel: Successfully spawned entity
INFO  [simulator] Simulator connected on TCP port 4560.
INFO  [commander] LED: open /dev/led0 failed (22)
INFO  [init] Mixer: etc/mixers/quad_x.main.mix on /dev/pwm_output0
INFO  [ekf2] starting instance 0, IMU:0 (1310988), MAG:0 (197388)
INFO  [ekf2] starting instance 1, IMU:1 (1310996), MAG:0 (197388)
INFO  [ekf2] starting instance 2, IMU:2 (1311004), MAG:0 (197388)
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO  [ekf2] starting instance 3, IMU:0 (1310988), MAG:1 (197644)
[vehicle_spawn_cesar_7124_7044491697582476719-4] process has finished cleanly
log file: /home/cesar/.ros/log/91ac3700-26c1-11ec-abf8-0800274d1c64/vehicle_spawn_cesar_7124_7044491697582476719-4*.log
INFO  [ekf2] starting instance 4, IMU:1 (1310996), MAG:1 (197644)
INFO  [ekf2] starting instance 5, IMU:2 (1311004), MAG:1 (197644)
INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO  [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO  [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] [logger] ./log/2021-10-06/16_22_18.ulg
INFO  [logger] Opened full log file: ./log/2021-10-06/16_22_18.ulg
INFO  [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO  [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO  [px4] Startup script returned successfully
pxh> [ INFO] [1633537338.154848491, 0.404000000]: udp0: Remote address: 127.0.0.1:14580
[ INFO] [1633537338.155262050, 0.404000000]: IMU: High resolution IMU detected!
INFO  [mavlink] partner IP: 127.0.0.1
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] reset position to last known position
INFO  [ecl/EKF] reset velocity to zero
INFO  [ecl/EKF] GPS checks passed
INFO  [ecl/EKF] GPS checks passed
INFO  [ecl/EKF] GPS checks passed
INFO  [ecl/EKF] GPS checks passed
INFO  [ecl/EKF] GPS checks passed
INFO  [ecl/EKF] GPS checks passed
[ INFO] [1633537339.126130191, 1.364000000]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1633537339.128274167, 1.364000000]: IMU: High resolution IMU detected!
[ INFO] [1633537340.144547657, 2.372000000]: GF: Using MISSION_ITEM_INT
[ INFO] [1633537340.144658190, 2.372000000]: RP: Using MISSION_ITEM_INT
[ INFO] [1633537340.144691300, 2.372000000]: WP: Using MISSION_ITEM_INT
[ INFO] [1633537340.144930815, 2.372000000]: VER: 1.1: Capabilities         0x000000000000e4ef
[ INFO] [1633537340.145022518, 2.372000000]: VER: 1.1: Flight software:     010c0000 (ade36c610f000000)
[ INFO] [1633537340.145039952, 2.372000000]: VER: 1.1: Middleware software: 010c0000 (ade36c610f000000)
[ INFO] [1633537340.145053858, 2.372000000]: VER: 1.1: OS software:         050400ff (bf06434168d1b604)
[ INFO] [1633537340.145249538, 2.372000000]: VER: 1.1: Board hardware:      00000001
[ INFO] [1633537340.145277398, 2.372000000]: VER: 1.1: VID/PID:             0000:0000
[ INFO] [1633537340.145294833, 2.372000000]: VER: 1.1: UID:                 4954414c44494e4f
INFO  [ecl/EKF] 4436000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
INFO  [ecl/EKF] 4440000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
INFO  [ecl/EKF] 4440000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
INFO  [ecl/EKF] 4444000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
[ INFO] [1633537342.497004797, 4.716000000]: IMU: Attitude quaternion IMU detected!
INFO  [ecl/EKF] 4512000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
INFO  [ecl/EKF] 4652000: EKF aligned, (baro hgt, IMU buf: 12, OBS buf: 9)
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [ecl/EKF] reset position to GPS
INFO  [ecl/EKF] reset velocity to GPS
INFO  [ecl/EKF] starting GPS fusion
INFO  [tone_alarm] home set
INFO  [tone_alarm] notify negative

Diagnostics

header: 
  seq: 538
  stamp: 
    secs: 534
    nsecs: 500000000
  frame_id: ''
status: 
  - 
    level: 0
    name: "mavros: FCU connection"
    message: "connected"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Received packets:"
        value: "6974"
      - 
        key: "Dropped packets:"
        value: "0"
      - 
        key: "Buffer overruns:"
        value: "0"
      - 
        key: "Parse errors:"
        value: "0"
      - 
        key: "Rx sequence number:"
        value: "62"
      - 
        key: "Tx sequence number:"
        value: "0"
      - 
        key: "Rx total bytes:"
        value: "12378780"
      - 
        key: "Tx total bytes:"
        value: "286960"
      - 
        key: "Rx speed:"
        value: "inf"
      - 
        key: "Tx speed:"
        value: "inf"
  - 
    level: 0
    name: "mavros: GPS"
    message: "3D fix"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Satellites visible"
        value: "10"
      - 
        key: "Fix type"
        value: "3"
      - 
        key: "EPH (m)"
        value: "0.00"
      - 
        key: "EPV (m)"
        value: "0.00"
  - 
    level: 0
    name: "mavros: Heartbeat"
    message: "Normal"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Heartbeats since startup"
        value: "534"
      - 
        key: "Frequency (Hz)"
        value: "1.000000"
      - 
        key: "Vehicle type"
        value: "Quadrotor"
      - 
        key: "Autopilot type"
        value: "PX4 Autopilot"
      - 
        key: "Mode"
        value: "AUTO.LOITER"
      - 
        key: "System status"
        value: "Calibrating"
  - 
    level: 2
    name: "mavros: System"
    message: "Sensor health"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Sensor present"
        value: "0x1028002C"
      - 
        key: "Sensor enabled"
        value: "0x1021000C"
      - 
        key: "Sensor health"
        value: "0x1028002F"
      - 
        key: "3D magnetometer"
        value: "Ok"
      - 
        key: "absolute pressure"
        value: "Ok"
      - 
        key: "rc receiver"
        value: "Fail"
      - 
        key: "AHRS subsystem health"
        value: "Ok"
      - 
        key: "pre-arm check status. Always healthy when armed"
        value: "Ok"
      - 
        key: "CPU Load (%)"
        value: "12.7"
      - 
        key: "Drop rate (%)"
        value: "0.0"
      - 
        key: "Errors comm"
        value: "0"
      - 
        key: "Errors count #1"
        value: "0"
      - 
        key: "Errors count #2"
        value: "0"
      - 
        key: "Errors count #3"
        value: "0"
      - 
        key: "Errors count #4"
        value: "0"
  - 
    level: 0
    name: "mavros: Battery"
    message: "Normal"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Voltage"
        value: "16.20"
      - 
        key: "Current"
        value: "-1.0"
      - 
        key: "Remaining"
        value: "100.0"
  - 
    level: 0
    name: "mavros: Time Sync"
    message: "Normal"
    hardware_id: "udp://:14540@localhost:14557"
    values: 
      - 
        key: "Timesyncs since startup"
        value: "5340"
      - 
        key: "Frequency (Hz)"
        value: "10.000000"
      - 
        key: "Last RTT (ms)"
        value: "0.000000"
      - 
        key: "Mean RTT (ms)"
        value: "0.054681"
      - 
        key: "Last remote time (s)"
        value: "534.240000000"
      - 
        key: "Estimated time offset (s)"
        value: "0.160258353"
---

Check ID

OK. I got messages from 1:1.

---
Received 5784 messages, from 1 addresses
sys:comp   list of messages
  1:1     0, 1, 2, 4, 8, 140, 141, 147, 148, 22, 24, 30, 31, 32, 33, 36, 44, 74, 331, 77, 83, 340, 85, 230, 105, 111, 241, 242, 245

cesar-source avatar Oct 06 '21 16:10 cesar-source

@cesar-source Are you sure you switched to offboard mode?

Jaeyoung-Lim avatar Oct 06 '21 21:10 Jaeyoung-Lim

@Jaeyoung-Lim Yes, I am. My script notifies me when I get booted out of offboard mode. I really did not understand what was going on and I tried your geometric controller example to compute the thrust and that and that has been working...

I am taking your thrust calculation but instead of sending a 0 rotation quaternion I save the original orientation of the drone and publish that to ~/setpoint_raw/attitude with your thrust commands. This worked over sending a 0 rotation quaternion.

This is odd though because I tried doing this with my own height controller and it did not work. Not sure why this is the case.

cesar-source avatar Oct 07 '21 14:10 cesar-source