mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
899 stars 994 forks source link

Problem with cmd_vel for steering the rover #1055

Closed ChouBot closed 5 years ago

ChouBot commented 6 years ago

I was using /mavros/rc/override on a pixhawk 1 in order to control the rover via an external pc, and this worked just fine. However, i needed to upgrade to the pixhawk 2 (the first one died), and now the RCoverride is no longer supported so i try now to control the rover by publishing to /mavros/setpoint_velocity/cmd_vel on GUIDED mode (otherwise the rover wouldn't respond).

Nonetheless, weird things are happening:

1- Sending +0.1 on twist.linear.x makes the robot moves forward (which is normal), but sending the same value on twist.linear.y makes the robot moves forward as well (which is not logical since this is not a holonomic platform, so no direction on the Y axis should be possible).

2- Sending -0.1 on twist.linear.x does not make the robot to move backward, but forward as well???

3- The angular velocity (twist.angular.z) seems to work fine with speed and direction (the robot is a bit shaking when turning on its center of gravity).

Any ideas about this?

Thank you in advance


Issue details

Please describe the problem, or desired feature

MAVROS version and platform

Mavros: latest_from_apt-get ROS: Kinetic Ubuntu: 16.04

Autopilot type and version

[ ] ArduPilot [X] PX4

Version: 3.4.0

Node logs

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: 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/id: 2
 * /mavros/distance_sensor/sonar_1_sub/orientation: PITCH_270
 * /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_protocol: v2.0
 * /mavros/fcu_url: /dev/ttyACM1:115200
 * /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.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/frame_tf/body_frame_orientation: frd
 * /mavros/odometry/frame_tf/local_frame: vision_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: False
 * /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_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: map
 * /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
 * /rosdistro: kinetic
 * /rosversion: 1.12.13

NODES
  /
    mavros (mavros/mavros_node)

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

setting /run_id to 746be1e4-85d0-11e8-adcd-000baba885bc
process[rosout-1]: started with pid [6510]
started core service [/rosout]
process[mavros-2]: started with pid [6528]
[ INFO] [1531399102.120351096]: FCU URL: /dev/ttyACM1:115200
[ INFO] [1531399102.125756136]: serial0: device: /dev/ttyACM1 @ 115200 bps
[ INFO] [1531399102.127059175]: GCS bridge disabled
[ INFO] [1531399102.170888509]: Plugin 3dr_radio loaded
[ INFO] [1531399102.179256409]: Plugin 3dr_radio initialized
[ INFO] [1531399102.179501756]: Plugin actuator_control loaded
[ INFO] [1531399102.197306650]: Plugin actuator_control initialized
[ INFO] [1531399102.207409027]: Plugin adsb loaded
[ INFO] [1531399102.226588616]: Plugin adsb initialized
[ INFO] [1531399102.227124441]: Plugin altitude loaded
[ INFO] [1531399102.232828157]: Plugin altitude initialized
[ INFO] [1531399102.233135403]: Plugin cam_imu_sync loaded
[ INFO] [1531399102.236295215]: Plugin cam_imu_sync initialized
[ INFO] [1531399102.236659485]: Plugin command loaded
[ INFO] [1531399102.267250791]: Plugin command initialized
[ INFO] [1531399102.267605088]: Plugin debug_value loaded
[ INFO] [1531399102.296158188]: Plugin debug_value initialized
[ INFO] [1531399102.296274963]: Plugin distance_sensor blacklisted
[ INFO] [1531399102.296583289]: Plugin fake_gps loaded
[ INFO] [1531399102.388802424]: Plugin fake_gps initialized
[ INFO] [1531399102.389210565]: Plugin ftp loaded
[ INFO] [1531399102.426106144]: Plugin ftp initialized
[ INFO] [1531399102.426680282]: Plugin global_position loaded
[ INFO] [1531399102.521575580]: Plugin global_position initialized
[ INFO] [1531399102.522026907]: Plugin hil loaded
[ INFO] [1531399102.614191262]: Plugin hil initialized
[ INFO] [1531399102.614597014]: Plugin home_position loaded
[ INFO] [1531399102.640176849]: Plugin home_position initialized
[ INFO] [1531399102.640602189]: Plugin imu loaded
[ INFO] [1531399102.693248084]: Plugin imu initialized
[ INFO] [1531399102.693736283]: Plugin local_position loaded
[ INFO] [1531399102.729450530]: Plugin local_position initialized
[ INFO] [1531399102.729865908]: Plugin manual_control loaded
[ INFO] [1531399102.751206995]: Plugin manual_control initialized
[ INFO] [1531399102.751492779]: Plugin mocap_pose_estimate loaded
[ INFO] [1531399102.777806113]: Plugin mocap_pose_estimate initialized
[ INFO] [1531399102.778145850]: Plugin obstacle_distance loaded
[ INFO] [1531399102.801032838]: Plugin obstacle_distance initialized
[ INFO] [1531399102.801393460]: Plugin odom loaded
[ INFO] [1531399102.828501421]: Plugin odom initialized
[ INFO] [1531399102.828936280]: Plugin param loaded
[ INFO] [1531399102.844216114]: Plugin param initialized
[ INFO] [1531399102.844571970]: Plugin px4flow loaded
[ INFO] [1531399102.892412516]: Plugin px4flow initialized
[ INFO] [1531399102.892859198]: Plugin rangefinder blacklisted
[ INFO] [1531399102.893604662]: Plugin rc_io loaded
[ INFO] [1531399102.917580094]: Plugin rc_io initialized
[ INFO] [1531399102.917688059]: Plugin safety_area blacklisted
[ INFO] [1531399102.918024723]: Plugin setpoint_accel loaded
[ INFO] [1531399102.938081314]: Plugin setpoint_accel initialized
[ INFO] [1531399102.938894823]: Plugin setpoint_attitude loaded
[ INFO] [1531399103.005479619]: Plugin setpoint_attitude initialized
[ INFO] [1531399103.005928785]: Plugin setpoint_position loaded
[ INFO] [1531399103.097636041]: Plugin setpoint_position initialized
[ INFO] [1531399103.098090812]: Plugin setpoint_raw loaded
[ INFO] [1531399103.157259945]: Plugin setpoint_raw initialized
[ INFO] [1531399103.157674471]: Plugin setpoint_velocity loaded
[ INFO] [1531399103.200485769]: Plugin setpoint_velocity initialized
[ INFO] [1531399103.201025352]: Plugin sys_status loaded
[ INFO] [1531399103.260157624]: Plugin sys_status initialized
[ INFO] [1531399103.260574575]: Plugin sys_time loaded
[ INFO] [1531399103.301524720]: TM: Timesync mode: MAVLINK
[ INFO] [1531399103.308377516]: Plugin sys_time initialized
[ INFO] [1531399103.308738174]: Plugin trajectory loaded
[ INFO] [1531399103.346481589]: Plugin trajectory initialized
[ INFO] [1531399103.347056603]: Plugin vfr_hud loaded
[ INFO] [1531399103.351187843]: Plugin vfr_hud initialized
[ INFO] [1531399103.351312431]: Plugin vibration blacklisted
[ INFO] [1531399103.351654304]: Plugin vision_pose_estimate loaded
[ INFO] [1531399103.404894694]: Plugin vision_pose_estimate initialized
[ INFO] [1531399103.405348060]: Plugin vision_speed_estimate loaded
[ INFO] [1531399103.429389615]: Plugin vision_speed_estimate initialized
[ INFO] [1531399103.429823357]: Plugin waypoint loaded
[ INFO] [1531399103.457782383]: Plugin waypoint initialized
[ INFO] [1531399103.458241535]: Plugin wind_estimation loaded
[ INFO] [1531399103.462428552]: Plugin wind_estimation initialized
[ INFO] [1531399103.462563583]: Autostarting mavlink via USB on PX4
[ INFO] [1531399103.462703006]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1531399103.462865955]: Built-in MAVLink package version: 2018.6.6
[ INFO] [1531399103.462971435]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1531399103.463073590]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1531399103.563323337]: CON: Got HEARTBEAT, connected. FCU: ArduPilotMega / ArduCopter
[ INFO] [1531399103.604669861]: IMU: Raw IMU message used.
[ INFO] [1531399103.606066749]: RC_CHANNELS message detected!
[ WARN] [1531399103.925041304]: TM : RTT too high for timesync: 15.17 ms.
[ WARN] [1531399104.524338765]: TM : RTT too high for timesync: 14.67 ms.
[ INFO] [1531399104.583780659]: VER: 1.1: Capabilities         0x00000000000011cf
[ INFO] [1531399104.584008471]: VER: 1.1: Flight software:     030400ff ( b5e3d08)
[ INFO] [1531399104.584171564]: VER: 1.1: Middleware software: 00000000 ( b535f97)
[ INFO] [1531399104.584344439]: VER: 1.1: OS software:         00000000 ( 1472b16)
[ INFO] [1531399104.584496814]: VER: 1.1: Board hardware:      00000000
[ INFO] [1531399104.584643187]: VER: 1.1: VID/PID:             0000:0000
[ INFO] [1531399104.584793941]: VER: 1.1: UID:                 0000000000000000
[ WARN] [1531399104.587500218]: CMD: Unexpected command 520, result 0
[ WARN] [1531399105.126616670]: TM : RTT too high for timesync: 16.96 ms.
[ WARN] [1531399105.725589325]: TM : RTT too high for timesync: 16.63 ms.
[ WARN] [1531399106.326636399]: TM : RTT too high for timesync: 17.37 ms.
[ WARN] [1531399106.926371251]: TM : RTT too high for timesync: 16.37 ms.
[ WARN] [1531399107.526387784]: TM : RTT too high for timesync: 17.35 ms.
[ WARN] [1531399108.125656486]: TM : RTT too high for timesync: 16.14 ms.
[ WARN] [1531399108.725584438]: TM : RTT too high for timesync: 16.08 ms.
[ WARN] [1531399109.326371533]: TM : RTT too high for timesync: 17.17 ms.
[ WARN] [1531399109.926576471]: TM : RTT too high for timesync: 16.70 ms.
[ WARN] [1531399110.525800992]: TM : RTT too high for timesync: 17.06 ms.
[ WARN] [1531399111.126573733]: TM : RTT too high for timesync: 17.55 ms.
[ WARN] [1531399111.725827443]: TM : RTT too high for timesync: 16.23 ms.
[ WARN] [1531399112.326185429]: TM : RTT too high for timesync: 16.97 ms.
[ WARN] [1531399112.926961146]: TM : RTT too high for timesync: 18.50 ms.
[ WARN] [1531399113.526185535]: TM : RTT too high for timesync: 16.29 ms.
[ INFO] [1531399113.564992498]: HP: requesting home position
[ INFO] [1531399113.587489146]: FCU: ArduRover V3.4.0 (b5e3d088)
[ INFO] [1531399113.588040299]: FCU: PX4: b535f974 NuttX: 1472b16c
[ INFO] [1531399113.588442942]: FCU: PX4v3 002E002C 33375110 37353832
[ WARN] [1531399114.565358912]: PR: request list timeout, retries left 2
[ WARN] [1531399115.566924878]: PR: request list timeout, retries left 1
[ WARN] [1531399116.567701953]: PR: request list timeout, retries left 0
[ WARN] [1531399118.572218676]: CMD: Unexpected command 410, result 0
[ WARN] [1531399118.647760237]: TM : RTT too high for timesync: 4439.14 ms.
[ INFO] [1531399118.688122621]: FCU: ArduRover V3.4.0 (b5e3d088)
[ INFO] [1531399118.688289987]: FCU: PX4: b535f974 NuttX: 1472b16c
[ INFO] [1531399118.688399704]: FCU: PX4v3 002E002C 33375110 37353832
[ WARN] [1531399118.729484676]: TM : RTT too high for timesync: 3920.87 ms.
[ WARN] [1531399118.808852824]: TM : RTT too high for timesync: 3400.34 ms.
[ INFO] [1531399118.809038962]: FCU: ArduRover V3.4.0 (b5e3d088)
[ INFO] [1531399118.809310332]: FCU: PX4: b535f974 NuttX: 1472b16c
[ INFO] [1531399118.809689546]: FCU: PX4v3 002E002C 33375110 37353832
[ WARN] [1531399118.870492560]: TM : RTT too high for timesync: 2861.31 ms.
[ INFO] [1531399118.948194420]: FCU: ArduRover V3.4.0 (b5e3d088)
[ INFO] [1531399118.948375181]: FCU: PX4: b535f974 NuttX: 1472b16c
[ INFO] [1531399118.948478633]: FCU: PX4v3 002E002C 33375110 37353832
[ WARN] [1531399118.948588830]: TM : RTT too high for timesync: 2339.49 ms.
[ WARN] [1531399119.047706012]: TM : RTT too high for timesync: 338.22 ms.
[ INFO] [1531399119.069592466]: WP: item #0  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870266 z: 255.799988
[ INFO] [1531399119.086404903]: WP: item #1  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701633 y: 10.870493 z: 255.379990
[ INFO] [1531399119.109187600]: WP: item #2  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701683 y: 10.870818 z: 255.649994
[ INFO] [1531399119.130015847]: WP: item #3  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701759 y: 10.870796 z: 255.250000
[ INFO] [1531399119.146872982]: WP: item #4  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701698 y: 10.870830 z: 255.599991
[ INFO] [1531399119.169497975]: WP: item #5  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701618 y: 10.870983 z: 256.259979
[ INFO] [1531399119.186298806]: WP: item #6  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701492 y: 10.871027 z: 256.089996
[ INFO] [1531399119.206011700]: WP: item #7  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701416 y: 10.870833 z: 256.739990
[ INFO] [1531399119.226667599]: WP: item #8  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701191 y: 10.870888 z: 256.729980
[ INFO] [1531399119.247134744]: WP: item #9  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.701126 y: 10.870580 z: 257.910004
[ INFO] [1531399119.268679709]: WP: item #10  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700924 y: 10.870431 z: 259.820007
[ INFO] [1531399119.285892088]: WP: item #11  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700806 y: 10.870382 z: 260.709991
[ INFO] [1531399119.308680187]: WP: item #12  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700756 y: 10.870100 z: 262.269989
[ INFO] [1531399119.329597974]: WP: item #13  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700603 y: 10.870128 z: 262.509979
[ WARN] [1531399119.330091730]: TM : RTT too high for timesync: 21.11 ms.
[ INFO] [1531399119.347558219]: WP: item #14  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870293 z: 251.110001
[ INFO] [1531399119.368721389]: WP: item #15  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870294 z: 251.080002
[ INFO] [1531399119.386089852]: WP: item #16  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870295 z: 251.099991
[ INFO] [1531399119.406030629]: WP: item #17  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870297 z: 251.139999
[ INFO] [1531399119.426468319]: WP: item #18  F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 60.700508 y: 10.870299 z: 251.119995
[ INFO] [1531399119.426696971]: WP: mission received

Diagnostics

header: 
  seq: 8
  stamp: 
    secs: 1531399325
    nsecs: 874325189
  frame_id: ''
status: 
  - 
    level: 0
    name: "mavros: FCU connection"
    message: "connected"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Received packets:"
        value: "540"
      - 
        key: "Dropped packets:"
        value: "0"
      - 
        key: "Buffer overruns:"
        value: "0"
      - 
        key: "Parse errors:"
        value: "0"
      - 
        key: "Rx sequence number:"
        value: "176"
      - 
        key: "Tx sequence number:"
        value: "31"
      - 
        key: "Rx total bytes:"
        value: "17220"
      - 
        key: "Tx total bytes:"
        value: "879"
      - 
        key: "Rx speed:"
        value: "2311.000000"
      - 
        key: "Tx speed:"
        value: "320.000000"
  - 
    level: 0
    name: "mavros: GPS"
    message: "3D fix"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Satellites visible"
        value: "9"
      - 
        key: "Fix type"
        value: "3"
      - 
        key: "EPH (m)"
        value: "0.94"
      - 
        key: "EPV (m)"
        value: "1.52"
  - 
    level: 0
    name: "mavros: Heartbeat"
    message: "Normal"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Heartbeats since startup"
        value: "3"
      - 
        key: "Frequency (Hz)"
        value: "1.087246"
      - 
        key: "Vehicle type"
        value: "Ground rover"
      - 
        key: "Autopilot type"
        value: "ArduPilotMega / ArduCopter"
      - 
        key: "Mode"
        value: "MANUAL"
      - 
        key: "System status"
        value: "Active"
  - 
    level: 0
    name: "mavros: System"
    message: "Normal"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Sensor present"
        value: "0x0320DC27"
      - 
        key: "Sensor enabled"
        value: "0x03208027"
      - 
        key: "Sensor helth"
        value: "0x0320DC27"
      - 
        key: "3D gyro"
        value: "Ok"
      - 
        key: "3D accelerometer"
        value: "Ok"
      - 
        key: "3D magnetometer"
        value: "Ok"
      - 
        key: "GPS"
        value: "Ok"
      - 
        key: "motor outputs / control"
        value: "Ok"
      - 
        key: "AHRS subsystem health"
        value: "Ok"
      - 
        key: "Logging"
        value: "Ok"
      - 
        key: "Battery"
        value: "Ok"
      - 
        key: "CPU Load (%)"
        value: "18.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: 1
    name: "mavros: Battery"
    message: "Low voltage"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Voltage"
        value: "0.00"
      - 
        key: "Current"
        value: "0.0"
      - 
        key: "Remaining"
        value: "98.0"
  - 
    level: 0
    name: "mavros: Time Sync"
    message: "Normal"
    hardware_id: "/dev/ttyACM1:115200"
    values: 
      - 
        key: "Timesyncs since startup"
        value: "26"
      - 
        key: "Frequency (Hz)"
        value: "9.613204"
      - 
        key: "Last RTT (ms)"
        value: "16.270802"
      - 
        key: "Mean RTT (ms)"
        value: "16.182200"
      - 
        key: "Last remote time (s)"
        value: "21004.780771000"
      - 
        key: "Estimated time offset (s)"
        value: "0.000000000"
---

Check ID

OK. I got messages from 1:1.

---
Received 1112 messages, from 1 addresses
sys:comp   list of messages
  1:1     0, 129, 2, 22, 1, 137, 128, 152, 147, 150, 24, 27, 29, 30, 32, 33, 34, 35, 36, 165, 193, 42, 178, 182, 65, 74, 163, 111, 241, 116, 124, 125
vooon commented 6 years ago

Unfortunately i do not see anything in this logs, except strange FW version reports. That may be caused by some commands or reboots. Unlikely that this is because reboot, because in that case drone would be uncontrollable for couple of seconds. But try to check wiring.

Also how autopilot is connected to mavros? High Round-Trip Time looks weird.

ChouBot commented 6 years ago

Thanks for your reply. I am using a rover (which can be as well called a drone, but just for avoiding confusion :D). The wiring is fine, since the manual + auto (WP from MP) work just fine, in addition i am able to communicate with the pixhawk, so i doubt that the wiring is the problem.

I have tried to connect the autopilot through the usb port on the pixhawk, and the telemetry port, but the results are the same.

Is there a way to send direct commands to the motors? something similar to rcoverride that was before?

vooon commented 6 years ago

You may try COMMAND_LONG with DO_SET_SERVO.

ChouBot commented 6 years ago

I am trying to send this command (to turn the right wheel attached to output 1 for 10 cycles of 10s):

rosservice call /mavros/cmd/command "{broadcast: true, command: 184, confirmation: 0, param1: 1.0, param2: 1600.0, param3: 10.0, param4: 10.0, param5: 0.0, param6: 0.0, param7: 0.0}"

Nothing is happening, should the rover be in GUIDED mode when using DO_SET_SERVO? or just manual mode?

Edit:

I tried as well with rosrun mavros mavcmd long 183 1 1600 0 0 0 0 0 and i am getting the error: Request failed. Check mavros logs. ACK: 4

khancyr commented 6 years ago

DO_SET_SERVO isn't implemented on on ArduPilot Rover (you write you are using PX4 but speak about Guided). RC override should work in non guided mode but you need to set SYSID_MYGCS to 1 . About setpoint velocity, the default frame is Local_ned, so you are sending a speed VECTOR in NED frame so x isn't front and y isn't lateral, that is doesn't match the default (and wrong) behavior from ROS that said the x is always front. And as we calculate the velocity vector, we lost the reverse movement. Changing the frame to body_frame should change this behavior .

ChouBot commented 6 years ago

I have already tried to set SYSID_MYGCS to 1 but the RC override was still present. I will try to change the frame and see if this will solve the problem.

hmchung commented 6 years ago

Hi guys. I got into the same issue:

1) I ran mavros with companion link 921600 2) I got the same warning message "TM : RTT too high for timesync" 3) Interestingly, with this, I could not send setpoints and could not enter offboard mode 4) Most amazingly, the issue goes away when I plug in the micro USB. But this is just a very bad hack.
5) The issue comes back when I unplug the USB cable.

Waiting for more comments.

[New update] The same trick works with a charging cable (no data wires). Seems like it needs to have some voltage regulation between OBC and FCU. If my guess is correct, I will need to connect the 5V wires for my case, unlike the original way of making companion cable. FYI, my setup is CUAV Pixhack and CUAV USB-UART converter board.

[New update] Using the companion cable WITH 5V line works. But maybe only applicable my hardware setup:

ChouBot commented 6 years ago

Thank you for your feedback. I have other projects going on, but for now i just used an arduino with a 5v switch in order to choose between who takes control of the ESCs (pc or Pixhawk)...It is a quick and dirty solution for my autonomous visual tracking and other schemes, but it works just fine.

I will try your trick soon (hopefully)

isakdiaz commented 6 years ago

You have to set the MAV_FRAME to the local bodyframe so that the commands are processed in that coordinate system.

Just run: rosservice call /mavros/setpoint_velocity/mav_frame "mav_frame: 8"

Here are more frames to try: https://github.com/mavlink/mavros/blob/master/mavros_msgs/srv/SetMavFrame.srv

ChouBot commented 5 years ago

Hello guys,

I finally figured it out, and i can now control the velocity of the rover directly through mavros.

First, the rover should be in GUIDED mode. To do this, whether you set this though your RC via MP or other GUI, or you simply use mavros. In another terminal (besides the one running mavros with the adequte autopilot, for me i used apm2.launch):

rosrun mavros mavsys -c GUIDED

Once the mode is changed, you can try publishing on the following topic: /mavros/setpoint_velocity/cmd_vel (for the rover, linear velocity on the x, and angular around z). You should be able to see the rover moving for few seconds.

rostopic pub /mavros/setpoint_velocity/cmd_vel geometry_msgs/TwistStamped "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' twist: linear: x: 0.5 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.3"

khancyr commented 5 years ago

@chouaibharik Thanks for the feedback ! I glad you manage to make it work . @TSC21 this issue could be close

githinkgp commented 5 years ago

@chouaibharik When you got it working what did you set your setpoint/velcoity/mav_frame to? Is it LOCAL_NED or BODY_NED?

I am also curious that in the TwistStamped message that you are publishing you have left the frame id slot. Did you leave it blank in your implementation as well?

rostopic pub /mavros/setpoint_velocity/cmd_vel geometry_msgs/TwistStamped "header: seq: 0 stamp: secs: 0 nsecs: 0 **frame_id: ''** twist: linear: x: 0.5 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.3"

Please let me know. Thank you

ChouBot commented 5 years ago

I haven't set the mav frame, and I left the frame id blank on the implementation as well.

githinkgp commented 5 years ago

frames.pdf @chouaibharik Thank you for the quick reply. I have been using PX4 and not ardupilot. The OFFBOARD mode in PX4 works the same way as GUIDED in AP. This is what I have been trying.

  1. roslaunch mavros px4.launch, with the timesync_rate disabled to avoid the WARN: RTT too high for timesync.
  2. The tf now looks like as attached.
  3. I then run a node to publish Twist message on mavros/setpoint_velocity/cmd_vel_unstamped at 10 Hz. I defined each of the linear and angular velcoities as ros paramters and initialized them to 0.
  4. Once I have the above node running, I switch the mode to OFFBOARD and then arm the vehicle. Both these happen successfully.
  5. Now I use the rosparam command to change the values of linear and angular velocity being published.

I do this and still get no response from the rover. I have tried publishing to the sepoint_velocity/cmd_vel topic in the same way you did but still couldn't get it to work. I tried giving x, y and z velcities but nothing worked.

I don’t know where I am going wrong.

Any suggestions would be helpful. Thank you.

These are my mavros params: 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: 0.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/id: 2
/mavros/distance_sensor/sonar_1_sub/orientation: PITCH_270
/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_protocol: v2.0
/mavros/fcu_url: /dev/ttyUSB0:57600
/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.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/in/child_frame_id: base_link
/mavros/odometry/in/frame_id: odom
/mavros/odometry/in/frame_tf/body_frame_orientation: flu
/mavros/odometry/in/frame_tf/local_frame: local_origin_ned
/mavros/odometry/out/frame_tf/body_frame_orientation: frd
/mavros/odometry/out/frame_tf/local_frame: vision_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: False
/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: map
/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: map
/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: map
/mavros/wheel_odometry/tf/send: True
/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: kinetic
/rosversion: 1.12.14

NODES / mavros (mavros/mavros_node)

ROS_MASTER_URI=http://localhost:11311

process[mavros-1]: started with pid [20916] [ INFO] [1558464788.290501886]: FCU URL: /dev/ttyUSB0:57600 [ INFO] [1558464788.295183023]: serial0: device: /dev/ttyUSB0 @ 57600 bps [ INFO] [1558464788.296668052]: GCS bridge disabled [ INFO] [1558464788.350821730]: Plugin 3dr_radio loaded [ INFO] [1558464788.357885414]: Plugin 3dr_radio initialized [ INFO] [1558464788.358143462]: Plugin actuator_control loaded [ INFO] [1558464788.384334140]: Plugin actuator_control initialized [ INFO] [1558464788.396739199]: Plugin adsb loaded [ INFO] [1558464788.425823976]: Plugin adsb initialized [ INFO] [1558464788.426536878]: Plugin altitude loaded [ INFO] [1558464788.433618353]: Plugin altitude initialized [ INFO] [1558464788.434105747]: Plugin cam_imu_sync loaded [ INFO] [1558464788.438499145]: Plugin cam_imu_sync initialized [ INFO] [1558464788.439022407]: Plugin command loaded [ INFO] [1558464788.493087808]: Plugin command initialized [ INFO] [1558464788.494082306]: Plugin companion_process_status loaded [ INFO] [1558464788.526164785]: Plugin companion_process_status initialized [ INFO] [1558464788.527494282]: Plugin debug_value loaded [ INFO] [1558464788.578460266]: Plugin debug_value initialized [ INFO] [1558464788.578667760]: Plugin distance_sensor blacklisted [ INFO] [1558464788.579473706]: Plugin fake_gps loaded [ INFO] [1558464788.732992796]: Plugin fake_gps initialized [ INFO] [1558464788.734053718]: Plugin ftp loaded [ INFO] [1558464788.790266688]: Plugin ftp initialized [ INFO] [1558464788.791021665]: Plugin global_position loaded [ INFO] [1558464788.939001902]: Plugin global_position initialized [ INFO] [1558464788.939907356]: Plugin gps_rtk loaded [ INFO] [1558464788.973748525]: Plugin gps_rtk initialized [ INFO] [1558464788.974481104]: Plugin hil loaded [ INFO] [1558464789.120889276]: Plugin hil initialized [ INFO] [1558464789.122349060]: Plugin home_position loaded [ INFO] [1558464789.168985200]: Plugin home_position initialized [ INFO] [1558464789.170254896]: Plugin imu loaded [ INFO] [1558464789.273023485]: Plugin imu initialized [ INFO] [1558464789.273575799]: Plugin local_position loaded [ INFO] [1558464789.355878038]: Plugin local_position initialized [ INFO] [1558464789.356926482]: Plugin log_transfer loaded [ INFO] [1558464789.386520641]: Plugin log_transfer initialized [ INFO] [1558464789.387113462]: Plugin manual_control loaded [ INFO] [1558464789.420090876]: Plugin manual_control initialized [ INFO] [1558464789.420738858]: Plugin mocap_pose_estimate loaded [ INFO] [1558464789.455150426]: Plugin mocap_pose_estimate initialized [ INFO] [1558464789.455765581]: Plugin obstacle_distance loaded [ INFO] [1558464789.483388117]: Plugin obstacle_distance initialized [ INFO] [1558464789.484022693]: Plugin odom loaded [ INFO] [1558464789.560436137]: Plugin odom initialized [ INFO] [1558464789.561657744]: Plugin param loaded [ INFO] [1558464789.599784684]: Plugin param initialized [ INFO] [1558464789.600721942]: Plugin px4flow loaded [ INFO] [1558464789.698656611]: Plugin px4flow initialized [ INFO] [1558464789.698771701]: Plugin rangefinder blacklisted [ INFO] [1558464789.699557841]: Plugin rc_io loaded [ INFO] [1558464789.739481291]: Plugin rc_io initialized [ INFO] [1558464789.739580159]: Plugin safety_area blacklisted [ INFO] [1558464789.740149591]: Plugin setpoint_accel loaded [ INFO] [1558464789.759514288]: Plugin setpoint_accel initialized [ INFO] [1558464789.759822697]: Plugin setpoint_attitude loaded [ INFO] [1558464789.809180862]: Plugin setpoint_attitude initialized [ INFO] [1558464789.810062959]: Plugin setpoint_position loaded [ INFO] [1558464789.898066335]: Plugin setpoint_position initialized [ INFO] [1558464789.899032870]: Plugin setpoint_raw loaded [ INFO] [1558464789.986934659]: Plugin setpoint_raw initialized [ INFO] [1558464789.988301687]: Plugin setpoint_velocity loaded [ INFO] [1558464790.038974189]: Plugin setpoint_velocity initialized [ INFO] [1558464790.039788327]: Plugin sys_status loaded [ INFO] [1558464790.137676302]: Plugin sys_status initialized [ INFO] [1558464790.139195919]: Plugin sys_time loaded [ INFO] [1558464790.193279452]: TM: Timesync mode: MAVLINK [ INFO] [1558464790.203495895]: Plugin sys_time initialized [ INFO] [1558464790.204172418]: Plugin trajectory loaded [ INFO] [1558464790.262563953]: Plugin trajectory initialized [ INFO] [1558464790.263851119]: Plugin vfr_hud loaded [ INFO] [1558464790.270397176]: Plugin vfr_hud initialized [ INFO] [1558464790.270586432]: Plugin vibration blacklisted [ INFO] [1558464790.271138714]: Plugin vision_pose_estimate loaded [ INFO] [1558464790.363144037]: Plugin vision_pose_estimate initialized [ INFO] [1558464790.364172772]: Plugin vision_speed_estimate loaded [ INFO] [1558464790.409601010]: Plugin vision_speed_estimate initialized [ INFO] [1558464790.411010145]: Plugin waypoint loaded [ INFO] [1558464790.460253103]: Plugin waypoint initialized [ INFO] [1558464790.460520045]: Plugin wheel_odometry blacklisted [ INFO] [1558464790.461924700]: Plugin wind_estimation loaded [ INFO] [1558464790.468775007]: Plugin wind_estimation initialized [ INFO] [1558464790.469057979]: Autostarting mavlink via USB on PX4 [ INFO] [1558464790.469322330]: Built-in SIMD instructions: ARM NEON [ INFO] [1558464790.469609206]: Built-in MAVLink package version: 2019.2.2 [ INFO] [1558464790.469870709]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta [ INFO] [1558464790.470158769]: MAVROS started. MY ID 1.240, TARGET ID 1.1 [ INFO] [1558464790.677648605]: RC_CHANNELS message detected! [ INFO] [1558464791.182722040]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot [ INFO] [1558464791.267209127]: RC_CHANNELS message detected! [ INFO] [1558464791.502010553]: IMU: High resolution IMU detected! [ INFO] [1558464792.227014851]: VER: 1.1: Capabilities 0x00000000000024ef [ INFO] [1558464792.227680560]: VER: 1.1: Flight software: 01060500 (3098c77c9168553c) [ INFO] [1558464792.228063104]: VER: 1.1: Middleware software: 01060500 (3098c77c9168553c) [ INFO] [1558464792.228373433]: VER: 1.1: OS software: 000000c0 (0000000000000000) [ INFO] [1558464792.228663732]: VER: 1.1: Board hardware: 00000011 [ INFO] [1558464792.228959311]: VER: 1.1: VID/PID: 26ac:0011 [ INFO] [1558464792.229246955]: VER: 1.1: UID: 3236511737353639

ChouBot commented 5 years ago

Do you see the topic /mavros/rc/override on the topics list?

githinkgp commented 5 years ago

Yes and nothing is published on it.

ChouBot commented 5 years ago

Of course not, it is a topic where you emulate a RC, so naturally nothing is published on that topic. Try to publish on it (just use rostopic pub command), while choosing the right channel for your motors.

kissw commented 4 years ago

@chouaibharik @githinkgp
I have the same problem. I want to reverse my vehicle, so I tried to the setpoint_velocity/cmd_vel/twist/linear/x value to negative, But the vehicle will not reverse. Strangely, changing the linear/y value causes the vehicle to move forward and steering.

Also, changing the angular/z value will not be steering, when the linear/x value is set to -1, the vehicle rotates clockwise in place as it moves forward.

The mode is the "Offboard" mode and the mavros/state/guided value is true. I tried to change the mav_frame value, but it wasn't resolved.

If you've solved it, could you explain it in more detail?

ChouBot commented 4 years ago

@chouaibharik @githinkgp I have the same problem. I want to reverse my vehicle, so I tried to the setpoint_velocity/cmd_vel/twist/linear/x value to negative, But the vehicle will not reverse. Strangely, changing the linear/y value causes the vehicle to move forward and steering.

Also, changing the angular/z value will not be steering, when the linear/x value is set to -1, the vehicle rotates clockwise in place as it moves forward.

The mode is the "Offboard" mode and the mavros/state/guided value is true. I tried to change the mav_frame value, but it wasn't resolved.

If you've solved it, could you explain it in more detail?

Have you tried the steps i explained in https://github.com/mavlink/mavros/issues/1055#issuecomment-489127132 ?

kissw commented 4 years ago

@chouaibharik Of course, mavros When I typing this command, result is this.

mavros2 I connected the mavros usingroslaunch px4 apm2.launch and entered Guided mode.

But the results are the same.

ChouBot commented 4 years ago

@kissw First, are you sure your autopilot is a px4 not an APM?. Second, you will need to add the guided mode on MP (for my case, i have a three way switch that i can chose between Stabilize, Guided and, Auto). Then the switch will be on the Guided position in order to be able to pass the commands to the autopilote.

Jaeyoung-Lim commented 4 years ago

@kissw I enabled velocity control for rover on px4. However, this was only enabled after PX4 v1.10 what version are you using?

kissw commented 4 years ago

@chouaibharik First, Yes, I'm using PX4. Second, Actually I'm testing in simulation environment... What is the MP?

@Jaeyoung-Lim I checked, it's a master branch. I'll change the firmware version to version 1.10, retest and let you know.

Jaeyoung-Lim commented 4 years ago

@kissw Which master are you on? If you are on master, you should be better of than 1.10 since the actuator controls should also be included.

Relevent PRs: https://github.com/PX4/Firmware/pull/13363 https://github.com/PX4/Firmware/pull/13225

ChouBot commented 4 years ago

@kissw MP is Mission Planner.

kissw commented 4 years ago

@Jaeyoung-Lim I tried to v1.11.0-beta1, but I still this ploblem. Here's the link that recorded my test. https://youtu.be/SJXJnuGTxIo

Jaeyoung-Lim commented 4 years ago

@kissw Oh, sorry. The vehicle will not reverse since it is constrained.

you can change that here: https://github.com/PX4/Firmware/blob/master/src/modules/rover_pos_control/RoverPositionControl.cpp#L301

kissw commented 4 years ago

@Jaeyoung-Lim Thank you so much! This Rover seems to be able to do something like path planning, but I want a simple Rover that can be controlled using angular.z and linear.x velocities. Is there the model or branch that i want?

Jaeyoung-Lim commented 4 years ago

@kissw Currently for offboard mode, the mavlink messages that are supported are listed in the docs, which mavros sends. It does not support path planning but supports following setpoints such as position, velocity, actuator setpoints.

It does not support angular velocities, although I was planning to add it. You can still use linear velocity in both body and local frame or use actuator controls directly. Were you able to make the rover go reverse with the suggested changes?

Since this thread is not directly related to your issue, I would prefer moving this discussion to a forum, somewhere like discuss.px4.io

kissw commented 4 years ago

@Jaeyoung-Lim Modification of the code have caused the Rover able to make reverse. But not only did the Rover reverse, it even steered to a 180 degree turn. i think it seems to need to be complemented. Anyway, Thank you very much for your reply.

Jaeyoung-Lim commented 4 years ago

@kissw That is why it was constrained. You need additional logic to handle reverse. Attitude setepoints support reverse: https://github.com/PX4/Firmware/pull/13429