mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
902 stars 993 forks source link

Offboard control does not work! #1340

Open netgittemp opened 5 years ago

netgittemp commented 5 years ago

Issue details

Hi, I installed mavros using $ sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras and I successfully worked with gazebo simulation for offboard example (https://dev.px4.io/v1.9.0/en/ros/mavros_offboard.html). I used the following commands;

~/src/Firmware$ sudo make px4_sitl gazebo
$ roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
~/catkin_ws$ rosrun px4_offboard offboard_ex

However, after installing rotor_simulator in "catkin_ws_RotorS" folder (https://github.com/ethz-asl/rotors_simulator) offboard mode does not work with the same commands.... I am not sure it is the problem, but for your information, I found mavros package is connected with mavros folder in the "catkin_ws_RotorS" using roscd

Could you give some advice for resolve this issue?

MAVROS version and platform

Mavros: ROS: Kinetic Ubuntu: 16.04

Autopilot type and version

[ ] ArduPilot [ 0 ] PX4

Version:

Node logs

~$ roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
... logging to /home/ubuntu-dell/.ros/log/b141ce30-fc1c-11e9-ae44-50eb719ed77f/roslaunch-ubuntu-dell-464.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.

/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/loader.py:409: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  data = yaml.load(text)
started roslaunch server http://ubuntu-dell:35247/

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: udp://:14540@127....
 * /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/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: 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: 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: kinetic
 * /rosversion: 1.12.14

NODES
  /
    mavros (mavros/mavros_node)

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

setting /run_id to b141ce30-fc1c-11e9-ae44-50eb719ed77f
process[rosout-1]: started with pid [505]
started core service [/rosout]
process[mavros-2]: started with pid [529]
[ INFO] [1572553580.706837218]: FCU URL: udp://:14540@127.0.0.1:14557
[ INFO] [1572553580.716329555]: udp0: Bind address: 0.0.0.0:14540
[ INFO] [1572553580.716964014]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1572553580.717733215]: GCS bridge disabled
[ INFO] [1572553580.722669589]: udp0: Remote address: 127.0.0.1:14580
[ INFO] [1572553580.768046388]: Plugin 3dr_radio loaded
[ INFO] [1572553580.776131865]: Plugin 3dr_radio initialized
[ INFO] [1572553580.776618259]: Plugin actuator_control loaded
[ INFO] [1572553580.796350309]: Plugin actuator_control initialized
[ INFO] [1572553580.815198891]: Plugin adsb loaded
[ INFO] [1572553580.831689489]: Plugin adsb initialized
[ INFO] [1572553580.832033179]: Plugin altitude loaded
[ INFO] [1572553580.838337043]: Plugin altitude initialized
[ INFO] [1572553580.838845380]: Plugin cam_imu_sync loaded
[ INFO] [1572553580.842396997]: Plugin cam_imu_sync initialized
[ INFO] [1572553580.844293202]: Plugin command loaded
[ INFO] [1572553580.881190954]: Plugin command initialized
[ INFO] [1572553580.881694575]: Plugin companion_process_status loaded
[ INFO] [1572553580.896945756]: Plugin companion_process_status initialized
[ INFO] [1572553580.897604244]: Plugin debug_value loaded
[ INFO] [1572553580.927289732]: Plugin debug_value initialized
[ INFO] [1572553580.927375113]: Plugin distance_sensor blacklisted
[ INFO] [1572553580.927787227]: Plugin fake_gps loaded
[ INFO] [1572553581.011700484]: Plugin fake_gps initialized
[ INFO] [1572553581.012311171]: Plugin ftp loaded
[ INFO] [1572553581.065142197]: Plugin ftp initialized
[ INFO] [1572553581.066022746]: Plugin global_position loaded
[ INFO] [1572553581.180260471]: Plugin global_position initialized
[ INFO] [1572553581.181737754]: Plugin gps_rtk loaded
[ INFO] [1572553581.193255567]: Plugin gps_rtk initialized
[ INFO] [1572553581.194492641]: Plugin hil loaded
[ INFO] [1572553581.279536163]: Plugin hil initialized
[ INFO] [1572553581.281077785]: Plugin home_position loaded
[ INFO] [1572553581.303380885]: Plugin home_position initialized
[ INFO] [1572553581.303796010]: Plugin imu loaded
[ INFO] [1572553581.352372160]: Plugin imu initialized
[ INFO] [1572553581.353110800]: Plugin landing_target loaded
[ INFO] [1572553581.452318603]: Plugin landing_target initialized
[ INFO] [1572553581.453220974]: Plugin local_position loaded
[ INFO] [1572553581.496142283]: Plugin local_position initialized
[ INFO] [1572553581.496949645]: Plugin log_transfer loaded
[ INFO] [1572553581.521915683]: Plugin log_transfer initialized
[ INFO] [1572553581.522480604]: Plugin manual_control loaded
[ INFO] [1572553581.541575208]: Plugin manual_control initialized
[ INFO] [1572553581.542127847]: Plugin mocap_pose_estimate loaded
[ INFO] [1572553581.573570771]: Plugin mocap_pose_estimate initialized
[ INFO] [1572553581.573887462]: Plugin mount_control loaded
[ INFO] [1572553581.603564638]: Plugin mount_control initialized
[ INFO] [1572553581.603890541]: Plugin obstacle_distance loaded
[ INFO] [1572553581.620592780]: Plugin obstacle_distance initialized
[ INFO] [1572553581.620914214]: Plugin odom loaded
[ INFO] [1572553581.653079743]: Plugin odom initialized
[ INFO] [1572553581.653370469]: Plugin onboard_computer_status loaded
[ INFO] [1572553581.669990081]: Plugin onboard_computer_status initialized
[ INFO] [1572553581.670586254]: Plugin param loaded
[ INFO] [1572553581.691529589]: Plugin param initialized
[ INFO] [1572553581.692451455]: Plugin px4flow loaded
[ INFO] [1572553581.738669209]: Plugin px4flow initialized
[ INFO] [1572553581.738953627]: Plugin rangefinder blacklisted
[ INFO] [1572553581.740597552]: Plugin rc_io loaded
[ INFO] [1572553581.766285490]: Plugin rc_io initialized
[ INFO] [1572553581.766366489]: Plugin safety_area blacklisted
[ INFO] [1572553581.766758137]: Plugin setpoint_accel loaded
[ INFO] [1572553581.790703580]: Plugin setpoint_accel initialized
[ INFO] [1572553581.792697102]: Plugin setpoint_attitude loaded
[ INFO] [1572553581.861348079]: Plugin setpoint_attitude initialized
[ INFO] [1572553581.862185496]: Plugin setpoint_position loaded
[ INFO] [1572553581.969011752]: Plugin setpoint_position initialized
[ INFO] [1572553581.969874372]: Plugin setpoint_raw loaded
[ INFO] [1572553582.031600311]: Plugin setpoint_raw initialized
[ INFO] [1572553582.032017658]: Plugin setpoint_velocity loaded
[ INFO] [1572553582.068098998]: Plugin setpoint_velocity initialized
[ INFO] [1572553582.069966213]: Plugin sys_status loaded
[ INFO] [1572553582.138052179]: Plugin sys_status initialized
[ INFO] [1572553582.139247585]: Plugin sys_time loaded
[ INFO] [1572553582.176884880]: TM: Timesync mode: MAVLINK
[ INFO] [1572553582.181905074]: Plugin sys_time initialized
[ INFO] [1572553582.183001028]: Plugin trajectory loaded
[ INFO] [1572553582.220970783]: Plugin trajectory initialized
[ INFO] [1572553582.222241048]: Plugin vfr_hud loaded
[ INFO] [1572553582.226271539]: Plugin vfr_hud initialized
[ INFO] [1572553582.226356356]: Plugin vibration blacklisted
[ INFO] [1572553582.226638448]: Plugin vision_pose_estimate loaded
[ INFO] [1572553582.278012953]: Plugin vision_pose_estimate initialized
[ INFO] [1572553582.278339099]: Plugin vision_speed_estimate loaded
[ INFO] [1572553582.307020963]: Plugin vision_speed_estimate initialized
[ INFO] [1572553582.307495889]: Plugin waypoint loaded
[ INFO] [1572553582.337815644]: Plugin waypoint initialized
[ INFO] [1572553582.337910480]: Plugin wheel_odometry blacklisted
[ INFO] [1572553582.338413845]: Plugin wind_estimation loaded
[ INFO] [1572553582.340990154]: Plugin wind_estimation initialized
[ INFO] [1572553582.341098568]: Autostarting mavlink via USB on PX4
[ INFO] [1572553582.341384906]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1572553582.341442084]: Built-in MAVLink package version: 2019.10.10
[ INFO] [1572553582.341489623]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1572553582.341550759]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1572553582.351813538]: IMU: Attitude quaternion IMU detected!
[ INFO] [1572553582.371197068]: IMU: High resolution IMU detected!
[ INFO] [1572553582.781558150]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1572553582.793495273]: IMU: Attitude quaternion IMU detected!
[ INFO] [1572553582.800372989]: IMU: High resolution IMU detected!
[ INFO] [1572553583.800598668]: VER: 1.1: Capabilities         0x000000000000e4ef
[ INFO] [1572553583.800780977]: VER: 1.1: Flight software:     010a0000 (549fb0d5de000000)
[ INFO] [1572553583.800920401]: VER: 1.1: Middleware software: 010a0000 (549fb0d5de000000)
[ INFO] [1572553583.801073812]: VER: 1.1: OS software:         040f00ff (d8da511082646d83)
[ INFO] [1572553583.801188623]: VER: 1.1: Board hardware:      00000001
[ INFO] [1572553583.801294749]: VER: 1.1: VID/PID:             0000:0000
[ INFO] [1572553583.801412922]: VER: 1.1: UID:                 4954414c44494e4f
[ WARN] [1572553583.802069761]: CMD: Unexpected command 520, result 0
[ INFO] [1572553592.782866901]: HP: requesting home position
[ INFO] [1572553597.783567885]: WP: mission received
[ERROR] [1572553597.984473553]: Client [/offb_node] wants topic /mavros/state to have datatype/md5sum [mavros_msgs/State/63d9a29b6abd9e0beeba06109556d062], but our version has [mavros_msgs/State/ce783f756cab1193cb71ba9e90fece50]. Dropping connection.
[ INFO] [1572553612.783197226]: HP: requesting home position
[ INFO] [1572553622.782818942]: HP: requesting home position
[ INFO] [1572553632.782954600]: HP: requesting home position
[ INFO] [1572553642.782418648]: HP: requesting home position
[ INFO] [1572553652.782983642]: HP: requesting home position
[ INFO] [1572553662.782922714]: HP: requesting home position
[ INFO] [1572553672.783050879]: HP: requesting home position
[ INFO] [1572553682.782964812]: HP: requesting home position
[ INFO] [1572553692.783014918]: HP: requesting home position

Diagnostics

$ rostopic echo -n1 /diagnostics
header: 
  seq: 58
  stamp: 
    secs: 1572553652
    nsecs: 842815834
  frame_id: ''
status: 
  - 
    level: 0
    name: "mavros: FCU connection"
    message: "connected"
    hardware_id: "udp://:14540@127.0.0.1:14557"
    values: 
      - 
        key: "Received packets:"
        value: "25864"
      - 
        key: "Dropped packets:"
        value: "0"
      - 
        key: "Buffer overruns:"
        value: "0"
      - 
        key: "Parse errors:"
        value: "0"
      - 
        key: "Rx sequence number:"
        value: "154"
      - 
        key: "Tx sequence number:"
        value: "0"
      - 
        key: "Rx total bytes:"
        value: "1567698"
      - 
        key: "Tx total bytes:"
        value: "40514"
      - 
        key: "Rx speed:"
        value: "32358.000000"
      - 
        key: "Tx speed:"
        value: "854.000000"
  - 
    level: 0
    name: "mavros: GPS"
    message: "3D fix"
    hardware_id: "udp://:14540@127.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@127.0.0.1:14557"
    values: 
      - 
        key: "Heartbeats since startup"
        value: "70"
      - 
        key: "Frequency (Hz)"
        value: "1.000027"
      - 
        key: "Vehicle type"
        value: "Quadrotor"
      - 
        key: "Autopilot type"
        value: "PX4 Autopilot"
      - 
        key: "Mode"
        value: "MANUAL"
      - 
        key: "System status"
        value: "Standby"
  - 
    level: 2
    name: "mavros: System"
    message: "Sensor health"
    hardware_id: "udp://:14540@127.0.0.1:14557"
    values: 
      - 
        key: "Sensor present"
        value: "0x0000002F"
      - 
        key: "Sensor enabled"
        value: "0x0020000F"
      - 
        key: "Sensor health"
        value: "0x0000002F"
      - 
        key: "3D gyro"
        value: "Ok"
      - 
        key: "3D accelerometer"
        value: "Ok"
      - 
        key: "3D magnetometer"
        value: "Ok"
      - 
        key: "absolute pressure"
        value: "Ok"
      - 
        key: "AHRS subsystem health"
        value: "Fail"
      - 
        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@127.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@127.0.0.1:14557"
    values: 
      - 
        key: "Timesyncs since startup"
        value: "706"
      - 
        key: "Frequency (Hz)"
        value: "10.000265"
      - 
        key: "Last RTT (ms)"
        value: "1.194847"
      - 
        key: "Mean RTT (ms)"
        value: "1.471830"
      - 
        key: "Last remote time (s)"
        value: "91.744000000"
      - 
        key: "Estimated time offset (s)"
        value: "1572553561.050406933"
---

Check ID

$ rosrun mavros checkid
OK. I got messages from 1:1.

---
Received 5259 messages, from 1 addresses
sys:comp   list of messages
  1:1     0, 1, 2, 4, 140, 141, 147, 24, 30, 31, 32, 36, 74, 331, 76, 77, 83, 340, 230, 105, 111, 241, 245
TSC21 commented 5 years ago

@netgittemp I am trying to understand what exact problem you are describing but the information you provide is kinda short.

However, after installing rotor_simulator in "catkin_ws_RotorS" folder (https://github.com/ethz-asl/rotors_simulator)

What does this have to do with what is described in https://dev.px4.io/v1.9.0/en/ros/mavros_offboard.html? What you see on that page is using sitl_gazebo with PX4 SITL, meaning that PX4 is running over SITL and connected to Gazebo through Mavlink. rotors_simulator is a package set (where sitl_gazebo has its origin), but for a long time the PX4 ecosystem focused its development on sitl_gazebo. So if you are trying to use rotors_simulator with the PX4 SITL, I advise you to bring your questions there instead.

In any case, I don't see anywhere this is an issue with MAVROS, but rather with what you are trying to do with rotors_simulator.

netgittemp commented 5 years ago

@TSC21 I am sorry for confusing you. I am trying to use offboard mode with MAVROS. As I mentioned in the post, I used

~/src/Firmware$ sudo make px4_sitl gazebo
$ roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
~/catkin_ws$ rosrun px4_offboard offboard_ex

However, the quadrotor in Gazebo does not move at all. The output of $ rostopic echo /mavros/state/ is

---
header: 
  seq: 48
  stamp: 
    secs: 1572622117
    nsecs: 473311580
  frame_id: ''
connected: True
armed: False
guided: True
manual_input: False
mode: "AUTO.LOITER"
system_status: 3
---

Could you help me to resolve this issue? Thanks.

netgittemp commented 5 years ago

FYI, I reinstalled ubuntu 16.04. and Installed ROS and mavros using Binary installation (deb) ( MAVROS pacakge is not in the catkin_ws, it is in the following directory.

$ roscd mavros
/opt/ros/kinetic/share/mavros$

)

Then, following commands work correctly hovering the quadrotor in Gazebo

~/src/Firmware$ sudo make px4_sitl gazebo
$ roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
~/catkin_ws$ rosrun px4_offboard offboard_ex

When I install mavros using Source installation, however, I do not know how to run offboard example. Because installing mavros generatescatkin_ws... I tried to create example package in /catkin_ws/src, and run $ catkin build. It did not work. So I make another workspace like catkin_ws_offboard, and build using catkin_build. Then, I got the error;

fatal error: mavros_msgs/CommandBool.h: No such file or directory
compilation terminated.
offboard_test/CMakeFiles/offboard_test.dir/build.make:62: recipe for target 'offboard_test/CMakeFiles/offboard_test.dir/src/offboard_test.cpp.o' failed
make[2]: *** [offboard_test/CMakeFiles/offboard_test.dir/src/offboard_test.cpp.o] Error 1
CMakeFiles/Makefile2:651: recipe for target 'offboard_test/CMakeFiles/offboard_test.dir/all' failed
make[1]: *** [offboard_test/CMakeFiles/offboard_test.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

So now, my question is that How to run offboard example with MAVROS which is installed via Source installation. In this case MAVROS package is in catkin_ws/src.

It would be very thankful if you help me. Thank you.

fabrizioschiano commented 4 years ago

Hi @netgittemp, did you solve your problem? I seem to have the same problem. It seems to be a problem with the mavros version but I don't know yet how to solve it.

demiryalin commented 4 years ago

you have to publish your messages at least with 2 hz. https://docs.px4.io/v1.9.0/en/flight_modes/offboard.html