weixin_39609622
2020-12-25 21:53 阅读 1

Cannot use target attitude in mavros

Hi guys,

I am new to mavros but I am thrilled to harness its power to control drone's position, state, heading autonomously.

I followed the offboard tutorial to control gazebo px4 from mavros node to set waypoints and that is working well. However what I thought would be a reasonable workflow to add heading/attitude to the drone while following waypoints turned out to be a difficult exercise.

I publish/subscribe to /mavros/setpoint_attitude/target_attitude. I am also using latest source mavros. I configured the yaml to use_quaternion=true and I am seeing callbacks firing when quaternion attitude is passed in.

I hardcode a reasonable 90 degree around-z quaternion : orientation: x: 0.0 y: 0.0 z: -0.707106769085 w: 0.707106769085

When I combine waypoints to mavros/setpoint_position/local and attitude to /mavros/setpoint_attitude/target_attitude

I get random drone turns and as it becomes unstable it crash-lands. My feeling is this is product of incorrect fusing of set position and set attitude, resulting in incoherent /mavros/imu/data or /mavros/local_position/pose.

When I read /mavros/local_position/pose I see that the orientation goes back and forth between stable constant orientation, what I perceive as result of mavros/setpoint_position/local, and /mavros/setpoint_attitude/target_attitude.

Please let me know if I am expecting too much from attitude handling of mavros but here is what I expect: I want to set target attitude to point in a given quaternion direction ( with identity quaternion being constructed from vector3( 1.0f, 0.0f, 0.0f ) ) and the drone should orient itself toward east. Getting frame of reference right is secondary. I would just like to say, make a 90 degree or 180 degree turn without losing altitude. Ideally, I want to reference a quaternion representing a rotation from 0 rotation and have drone follow that rotation.

Many thanks in advance for any assistance!

Thanks, ypv

MAVROS version and platform

Mavros: 0.21.2 ROS: Kinetic Ubuntu: 16.04

Autopilot type and version

[ ] ArduPilot [ * ] PX4

Version: v1.6.5 ( I believe )

Node logs


roslaunch mavros px4.launch fcu_url:="udp://:14540.0.0.1:14557" gcs_url:="udp://.17.0.1"
... logging to /home/user/.ros/log/3e575b9c-bcdb-11e7-9c18-00dbdf670b9c/roslaunch-ypv-Inspiron-7559-6064.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ypv-Inspiron-7559:38517/

SUMMARY
========

CLEAR PARAMETERS
 * /mavros/

PARAMETERS
 * /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: ROLL_180
 * /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: ROLL_180
 * /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: ROLL_180
 * /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/id: 2
 * /mavros/distance_sensor/sonar_1_sub/orientation: ROLL_180
 * /mavros/distance_sensor/sonar_1_sub/subscriber: True
 * /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_url: udp://:14540....
 * /mavros/gcs_url: udp://.17.0.1
 * /mavros/global_position/frame_id: map
 * /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.000349065850399
 * /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/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/mocap/use_pose: True
 * /mavros/mocap/use_tf: False
 * /mavros/odometry/estimator_type: 3
 * /mavros/odometry/frame_tf/desired_frame: ned
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.118682389136
 * /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/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/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: map
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: False
 * /rosdistro: kinetic
 * /rosversion: 1.12.7

NODES
  /
    mavros (mavros/mavros_node)

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

setting /run_id to 3e575b9c-bcdb-11e7-9c18-00dbdf670b9c
process[rosout-1]: started with pid [6088]
started core service [/rosout]
process[mavros-2]: started with pid [6103]
[ INFO] [1509303549.450765881]: FCU URL: udp://:14540.0.0.1:14557
[ WARN] [1509303549.451683144]: init: message from ASLUAV, MSG-ID 201 ignored! Table has different entry.
[ WARN] [1509303549.451863828]: init: message from autoquad, MSG-ID 150 ignored! Table has different entry.
[ WARN] [1509303549.451878062]: init: message from autoquad, MSG-ID 152 ignored! Table has different entry.
[ WARN] [1509303549.452034198]: init: message from matrixpilot, MSG-ID 150 ignored! Table has different entry.
[ WARN] [1509303549.452045268]: init: message from matrixpilot, MSG-ID 151 ignored! Table has different entry.
[ WARN] [1509303549.452054607]: init: message from matrixpilot, MSG-ID 152 ignored! Table has different entry.
[ WARN] [1509303549.452063820]: init: message from matrixpilot, MSG-ID 153 ignored! Table has different entry.
[ WARN] [1509303549.452073472]: init: message from matrixpilot, MSG-ID 155 ignored! Table has different entry.
[ WARN] [1509303549.452083078]: init: message from matrixpilot, MSG-ID 156 ignored! Table has different entry.
[ WARN] [1509303549.452090866]: init: message from matrixpilot, MSG-ID 157 ignored! Table has different entry.
[ WARN] [1509303549.452098761]: init: message from matrixpilot, MSG-ID 158 ignored! Table has different entry.
[ WARN] [1509303549.452107109]: init: message from matrixpilot, MSG-ID 170 ignored! Table has different entry.
[ WARN] [1509303549.452116552]: init: message from matrixpilot, MSG-ID 171 ignored! Table has different entry.
[ WARN] [1509303549.452125540]: init: message from matrixpilot, MSG-ID 172 ignored! Table has different entry.
[ WARN] [1509303549.452134672]: init: message from matrixpilot, MSG-ID 173 ignored! Table has different entry.
[ WARN] [1509303549.452143789]: init: message from matrixpilot, MSG-ID 174 ignored! Table has different entry.
[ WARN] [1509303549.452153004]: init: message from matrixpilot, MSG-ID 175 ignored! Table has different entry.
[ WARN] [1509303549.452161834]: init: message from matrixpilot, MSG-ID 176 ignored! Table has different entry.
[ WARN] [1509303549.452171158]: init: message from matrixpilot, MSG-ID 177 ignored! Table has different entry.
[ WARN] [1509303549.452179106]: init: message from matrixpilot, MSG-ID 178 ignored! Table has different entry.
[ WARN] [1509303549.452186976]: init: message from matrixpilot, MSG-ID 179 ignored! Table has different entry.
[ WARN] [1509303549.452194691]: init: message from matrixpilot, MSG-ID 180 ignored! Table has different entry.
[ WARN] [1509303549.452204603]: init: message from matrixpilot, MSG-ID 181 ignored! Table has different entry.
[ WARN] [1509303549.452213726]: init: message from matrixpilot, MSG-ID 182 ignored! Table has different entry.
[ WARN] [1509303549.452224100]: init: message from matrixpilot, MSG-ID 183 ignored! Table has different entry.
[ WARN] [1509303549.452232968]: init: message from matrixpilot, MSG-ID 184 ignored! Table has different entry.
[ WARN] [1509303549.452242897]: init: message from matrixpilot, MSG-ID 185 ignored! Table has different entry.
[ WARN] [1509303549.452252629]: init: message from matrixpilot, MSG-ID 186 ignored! Table has different entry.
[ WARN] [1509303549.452413756]: init: message from paparazzi, MSG-ID 180 ignored! Table has different entry.
[ WARN] [1509303549.452423689]: init: message from paparazzi, MSG-ID 181 ignored! Table has different entry.
[ WARN] [1509303549.452432886]: init: message from paparazzi, MSG-ID 182 ignored! Table has different entry.
[ WARN] [1509303549.452441913]: init: message from paparazzi, MSG-ID 183 ignored! Table has different entry.
[ WARN] [1509303549.452450797]: init: message from paparazzi, MSG-ID 184 ignored! Table has different entry.
[ WARN] [1509303549.452601981]: init: message from slugs, MSG-ID 170 ignored! Table has different entry.
[ WARN] [1509303549.452613070]: init: message from slugs, MSG-ID 172 ignored! Table has different entry.
[ WARN] [1509303549.452628304]: init: message from slugs, MSG-ID 173 ignored! Table has different entry.
[ WARN] [1509303549.452637586]: init: message from slugs, MSG-ID 176 ignored! Table has different entry.
[ WARN] [1509303549.452646304]: init: message from slugs, MSG-ID 177 ignored! Table has different entry.
[ WARN] [1509303549.452655252]: init: message from slugs, MSG-ID 179 ignored! Table has different entry.
[ WARN] [1509303549.452664522]: init: message from slugs, MSG-ID 180 ignored! Table has different entry.
[ WARN] [1509303549.452673437]: init: message from slugs, MSG-ID 181 ignored! Table has different entry.
[ WARN] [1509303549.452843085]: init: message from slugs, MSG-ID 184 ignored! Table has different entry.
[ WARN] [1509303549.452855638]: init: message from slugs, MSG-ID 185 ignored! Table has different entry.
[ WARN] [1509303549.452865172]: init: message from slugs, MSG-ID 186 ignored! Table has different entry.
[ WARN] [1509303549.452873048]: init: message from slugs, MSG-ID 188 ignored! Table has different entry.
[ WARN] [1509303549.452886039]: init: message from slugs, MSG-ID 191 ignored! Table has different entry.
[ WARN] [1509303549.452894801]: init: message from slugs, MSG-ID 192 ignored! Table has different entry.
[ WARN] [1509303549.452903166]: init: message from slugs, MSG-ID 193 ignored! Table has different entry.
[ WARN] [1509303549.452911919]: init: message from slugs, MSG-ID 194 ignored! Table has different entry.
[ INFO] [1509303549.453611570]: udp0: Bind address: 0.0.0.0:14540
[ INFO] [1509303549.453670941]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1509303549.453895134]: GCS URL: udp://.17.0.1
[ INFO] [1509303549.454064179]: udp1: Bind address: 0.0.0.0:14555
[ INFO] [1509303549.454137333]: udp1: Remote address: 172.17.0.1:14550
[ INFO] [1509303549.460762219]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1509303549.502586062]: Plugin 3dr_radio loaded
[ INFO] [1509303549.505434130]: Plugin 3dr_radio initialized
[ INFO] [1509303549.505673081]: Plugin actuator_control loaded
[ INFO] [1509303549.510475162]: Plugin actuator_control initialized
[ INFO] [1509303549.548304390]: Plugin adsb loaded
[ INFO] [1509303549.553087065]: Plugin adsb initialized
[ INFO] [1509303549.553358031]: Plugin altitude loaded
[ INFO] [1509303549.555055052]: Plugin altitude initialized
[ INFO] [1509303549.555234389]: Plugin cam_imu_sync loaded
[ INFO] [1509303549.556513925]: Plugin cam_imu_sync initialized
[ INFO] [1509303549.556898599]: Plugin command loaded
[ INFO] [1509303549.565000881]: Plugin command initialized
[ INFO] [1509303549.565166328]: Plugin debug_value loaded
[ INFO] [1509303549.582400852]: Plugin debug_value initialized
[ INFO] [1509303549.582444068]: Plugin distance_sensor blacklisted
[ INFO] [1509303549.582615059]: Plugin fake_gps loaded
[ INFO] [1509303549.602456397]: Plugin fake_gps initialized
[ INFO] [1509303549.602713125]: Plugin ftp loaded
[ INFO] [1509303549.616599437]: Plugin ftp initialized
[ INFO] [1509303549.616801521]: Plugin global_position loaded
[ INFO] [1509303549.644919755]: Plugin global_position initialized
[ INFO] [1509303549.645439198]: Plugin hil loaded
[ INFO] [1509303549.669184261]: Plugin hil initialized
[ INFO] [1509303549.669388761]: Plugin home_position loaded
[ INFO] [1509303549.676299144]: Plugin home_position initialized
[ INFO] [1509303549.676582705]: Plugin imu loaded
[ INFO] [1509303549.687625207]: Plugin imu initialized
[ INFO] [1509303549.687858402]: Plugin local_position loaded
[ INFO] [1509303549.696297845]: Plugin local_position initialized
[ INFO] [1509303549.696489520]: Plugin manual_control loaded
[ INFO] [1509303549.697509457]: Plugin manual_control initialized
[ INFO] [1509303549.697654636]: Plugin mocap_pose_estimate loaded
[ INFO] [1509303549.703442116]: Plugin mocap_pose_estimate initialized
[ INFO] [1509303549.703655927]: Plugin odom loaded
[ INFO] [1509303549.708839326]: Plugin odom initialized
[ INFO] [1509303549.709123567]: Plugin param loaded
[ INFO] [1509303549.713313020]: Plugin param initialized
[ INFO] [1509303549.713523355]: Plugin px4flow loaded
[ INFO] [1509303549.721324997]: Plugin px4flow initialized
[ INFO] [1509303549.721363704]: Plugin rangefinder blacklisted
[ INFO] [1509303549.721762449]: Plugin rc_io loaded
[ INFO] [1509303549.727245927]: Plugin rc_io initialized
[ INFO] [1509303549.727283848]: Plugin safety_area blacklisted
[ INFO] [1509303549.727461831]: Plugin setpoint_accel loaded
[ INFO] [1509303549.737473326]: Plugin setpoint_accel initialized
[ INFO] [1509303549.737767871]: Plugin setpoint_attitude loaded
 !!!!!!!!!!!!!!!use quaternion!!!!!!!!!! 
 !!!!!!!!!!!!!!!use quaternion!!!!!!!!!! 
[ INFO] [1509303549.755175637]: Plugin setpoint_attitude initialized
[ INFO] [1509303549.755383014]: Plugin setpoint_position loaded
[ INFO] [1509303549.766090130]: Plugin setpoint_position initialized
[ INFO] [1509303549.766319809]: Plugin setpoint_raw loaded
[ INFO] [1509303549.784208983]: Plugin setpoint_raw initialized
[ INFO] [1509303549.784484766]: Plugin setpoint_velocity loaded
[ INFO] [1509303549.794496074]: Plugin setpoint_velocity initialized
[ INFO] [1509303549.794933290]: Plugin sys_status loaded
[ INFO] [1509303549.804743836]: Plugin sys_status initialized
[ INFO] [1509303549.804979659]: Plugin sys_time loaded
[ INFO] [1509303549.809242096]: TM: Timesync mode: MAVLINK
[ INFO] [1509303549.810301972]: Plugin sys_time initialized
[ INFO] [1509303549.810495924]: Plugin vfr_hud loaded
[ INFO] [1509303549.813346118]: Plugin vfr_hud initialized
[ INFO] [1509303549.813390142]: Plugin vibration blacklisted
[ INFO] [1509303549.813700395]: Plugin vision_pose_estimate loaded
[ INFO] [1509303549.824914952]: Plugin vision_pose_estimate initialized
[ INFO] [1509303549.825086594]: Plugin vision_speed_estimate loaded
[ INFO] [1509303549.830077765]: Plugin vision_speed_estimate initialized
[ INFO] [1509303549.830377100]: Plugin waypoint loaded
[ INFO] [1509303549.839678724]: Plugin waypoint initialized
[ INFO] [1509303549.839785748]: Autostarting mavlink via USB on PX4
[ INFO] [1509303549.839981190]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1509303549.839998662]: Built-in MAVLink package version: 2017.10.10
[ INFO] [1509303549.840019778]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1509303549.840035068]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1509303549.843611821]: IMU: High resolution IMU detected!
[ INFO] [1509303549.844474948]: IMU: Attitude quaternion IMU detected!
[ WARN] [1509303549.910694675]: TM: Clock skew detected (-1509303485.149040699 s). Hard syncing clocks.
[ INFO] [1509303550.226443351]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1509303550.227718093]: IMU: High resolution IMU detected!
[ INFO] [1509303550.228218327]: IMU: Attitude quaternion IMU detected!
[ INFO] [1509303551.229460770]: VER: 1.1: Capabilities         0x000000000000e4ef
[ INFO] [1509303551.229500961]: VER: 1.1: Flight software:     01060580 (00000000634FF6D6)
[ INFO] [1509303551.229522772]: VER: 1.1: Middleware software: 01060580 (00000000634FF6D6)
[ INFO] [1509303551.229539301]: VER: 1.1: OS software:         040800ff (0000000000000000)
[ INFO] [1509303551.229552757]: VER: 1.1: Board hardware:      00000001
[ INFO] [1509303551.229566861]: VER: 1.1: VID/PID:             0000:0000
[ INFO] [1509303551.229578905]: VER: 1.1: UID:                 0000000100000002
[ WARN] [1509303551.229692121]: CMD: Unexpected command 520, result 0

Diagnostics

yaml
header: 
  seq: 13
  stamp: 
    secs: 1509303661
    nsecs: 978913467
  frame_id: ''
status: 
  - 
    level: 0
    name: mavros: FCU connection
    message: connected
    hardware_id: udp://:14540.0.0.1:14557
    values: 
      - 
        key: Received packets:
        value: 1880
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 199
      - 
        key: Tx sequence number:
        value: 98
      - 
        key: Rx total bytes:
        value: 78890
      - 
        key: Tx total bytes:
        value: 2354
      - 
        key: Rx speed:
        value: 24642.000000
      - 
        key: Tx speed:
        value: 757.000000
  - 
    level: 0
    name: mavros: GPS
    message: 3D fix
    hardware_id: udp://:14540.0.0.1: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.0.0.1:14557
    values: 
      - 
        key: Heartbeats since startup
        value: 4
      - 
        key: Frequency (Hz)
        value: 0.880073
      - 
        key: Vehicle type
        value: Quadrotor
      - 
        key: Autopilot type
        value: PX4 Autopilot
      - 
        key: Mode
        value: AUTO.RTL
      - 
        key: System status
        value: Standby
  - 
    level: 0
    name: mavros: System
    message: Normal
    hardware_id: udp://:14540.0.0.1:14557
    values: 
      - 
        key: Sensor present
        value: 0x00000000
      - 
        key: Sensor enabled
        value: 0x00000000
      - 
        key: Sensor helth
        value: 0x00000000
      - 
        key: CPU Load (%)
        value: 0.0
      - 
        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.0.0.1:14557
    values: 
      - 
        key: Voltage
        value: 12.15
      - 
        key: Current
        value: -1.0
      - 
        key: Remaining
        value: 100.0
  - 
    level: 0
    name: mavros: Time Sync
    message: Normal
    hardware_id: udp://:14540.0.0.1:14557
    values: 
      - 
        key: Timesyncs since startup
        value: 28
      - 
        key: Frequency (Hz)
        value: 9.898637
      - 
        key: Last dt (ms)
        value: -1.238923
      - 
        key: Mean dt (ms)
        value: -1.983774
      - 
        key: Last system time (s)
        value: 174.954356000
      - 
        key: Time offset (s)
        value: 1509303486.993827581
---

Check ID


user-Inspiron-7559:/$ rosrun mavros checkid
OK. I got messages from 1:1.

---
Received 5823 messages, from 1 addresses
sys:comp   list of messages
  1:1     0, 1, 2, 140, 141, 147, 24, 30, 31, 32, 33, 74, 76, 85, 87, 102, 230, 105, 106, 111, 241, 242, 245

该提问来源于开源项目:mavlink/mavros

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39609622 weixin_39609622 2020-12-25 21:53

    Can anyone please comment at least in the general idea of the solution, applying orientation in offboard mode? Is there a better method?

    点赞 评论 复制链接分享
  • weixin_39559750 weixin_39559750 2020-12-25 21:53

    you cannot use setpoint_altitude at the same time as setpoint_position. You use one or another. If you want to control yaw, you can control it by value or by rate. With setpoint_position you can control position+yaw(heading). With setpoint_velocity you can control velocity+yaw_rate. With setpoint_raw, depending on the bitmask you use on your msg, you can do multiple types of control (position+yaw_rate, velocity+yaw, XY_velocity+Z_height, etc.). But for attitude control, you cannot use just the orientation quaternions, you also need to publish the respective thrust value.

    点赞 评论 复制链接分享
  • weixin_39609622 weixin_39609622 2020-12-25 21:53

    Just to add more information for the solution I found. It turned out that inside /mavros/setpoint_position/local, position and orientation were everything that I needed. Once I fixed my quaternion interpolation, orientation worked very well.

    点赞 评论 复制链接分享
  • weixin_39902545 weixin_39902545 2020-12-25 21:53

    Dear Sir,

    We're running in Offboard mode and sending a set_attitude_target message through Mavlink. The PX4 version is 1.6.5 on Intel Aero.

    It seems that the roll and pitch angle/rate commands work fine but the yaw angle/rate doesn't work at all.

    Please advise

    点赞 评论 复制链接分享