Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't start HIL,need help #412

Closed
killerlayup opened this issue Oct 29, 2015 · 47 comments
Closed

can't start HIL,need help #412

killerlayup opened this issue Oct 29, 2015 · 47 comments

Comments

@killerlayup
Copy link

Hi, all

I follow the setup on http://pixhawk.org/dev/ros/hil, and can start jMAVSim and verify that it is communicating with the Pixhawk as it prints:

joel@joel-X450VC:~/jMAVSim$ java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar   
me.drton.jmavsim.Simulator -serial /dev/ttyACM0 921600 -qgc
Success!
3D [dev] 1.6.0-pre12-daily-experimental daily

Init MAVLink
MSG: Switched to ON hil state
MSG: [cmd] DISARMED by set mode command

but when I run :

cd ~/ros_catkin_ws  (or cd ~/catkin_ws) 
roslaunch mavros px4.launch

It seems that it is not communicating with pixhawk, no heartbeat. when I run:

rosrun mavros mavsys mode -c OFFBOARD

it shows:

[ INFO] [1446107174.611400916]: Autostarting mavlink via USB on PX4
[ INFO] [1446107174.611560334]: MAVROS started. MY ID [1, 240], TARGET ID [1, 1]
[ERROR] [1446107208.174644376]: MODE: Unsupported FCU

by the way, I use ubuntu 12.04,and px4 firmware, really need help~

@vooon vooon added the question label Oct 29, 2015
@vooon
Copy link
Member

vooon commented Oct 29, 2015

Dump here rostopic echo -n1 /diagnostics.

What version of mavros, px4 and ROS used?
You do not have connection, do not expect that set_mode will work.

@vooon vooon added the PX4 label Oct 29, 2015
@killerlayup
Copy link
Author

I use ros hydro and the latest px4, and hydro level mavros.

I think jMAVSim is connecting with the Pixhawk, as it shows:

Init MAVLink
MSG: Switched to ON hil state
MSG: [cmd] DISARMED by set mode command

in http://pixhawk.org/dev/ros/hil it says:

                 setpoint_demo.py
                   /
QGC <-> ROS/Mavros <-> jMAVSim <-> Pixhawk

so I think it may be something wrong between jMAVSim and Mavros.

@killerlayup
Copy link
Author

i run rostopic echo -n1 /diagnostics:

header: 
  seq: 1745
  stamp: 
    secs: 1446108917
    nsecs: 55892033
  frame_id: ''
status: 
  - 
    level: 1
    name: mavros: FCU connection
    message: not connected
    hardware_id: Mavlink
    values: 
      - 
        key: Received packets:
        value: 0
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 0
      - 
        key: Tx sequence number:
        value: 0
  - 
    level: 0
    name: mavros: GCS bridge
    message: connected
    hardware_id: Mavlink
    values: 
      - 
        key: Received packets:
        value: 0
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 0
      - 
        key: Tx sequence number:
        value: 0
  - 
    level: 2
    name: mavros: GPS
    message: No satellites
    hardware_id: Mavlink
    values: 
      - 
        key: Satellites visible
        value: -1
      - 
        key: Fix type
        value: 0
      - 
        key: EPH (m)
        value: Unknown
      - 
        key: EPV (m)
        value: Unknown
  - 
    level: 2
    name: mavros: Heartbeat
    message: No events recorded.
    hardware_id: Mavlink
    values: 
      - 
        key: Events in window
        value: 0
      - 
        key: Events since startup
        value: 0
      - 
        key: Duration of window (s)
        value: 10.008362
      - 
        key: Actual frequency (Hz)
        value: 0.000000
      - 
        key: MAV Type
        value: 0
      - 
        key: Autopilot type
        value: 0
      - 
        key: Autopilot base mode
        value: 0x00
      - 
        key: Autopilot custom mode
        value: 0x00000000
      - 
        key: Autopilot system status
        value: 0
  - 
    level: 0
    name: mavros: System
    message: Normal
    hardware_id: Mavlink
    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: 2
    name: mavros: Battery
    message: No data
    hardware_id: Mavlink
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        key: Current
        value: 0.0
      - 
        key: Remaining
        value: 0.0
  - 
    level: 2
    name: mavros: APM Memory
    message: No data
    hardware_id: Mavlink
    values: 
      - 
        key: Free memory (B)
        value: -1
      - 
        key: Heap top
        value: 0x0000
  - 
    level: 2
    name: mavros: APM Hardware
    message: No data
    hardware_id: Mavlink
    values: 
      - 
        key: Core voltage
        value: -1.000000
      - 
        key: I2C errors
        value: 0
  - 
    level: 2
    name: mavros: Time Sync
    message: No events recorded.
    hardware_id: Mavlink
    values: 
      - 
        key: Events in window
        value: 0
      - 
        key: Events since startup
        value: 0
      - 
        key: Duration of window (s)
        value: 10.008364
      - 
        key: Actual frequency (Hz)
        value: 0.000000
      - 
        key: Last dt (ms)
        value: 0.000
      - 
        key: Mean dt (ms)
        value: 0.000
      - 
        key: Last system time (s)
        value: 590726812732.479492
---

@vooon
Copy link
Member

vooon commented Oct 29, 2015

I think you should use that launch: https://github.com/PX4/Firmware/blob/master/launch/mavros_sitl.launch

And your mavros too old.

@vooon
Copy link
Member

vooon commented Oct 29, 2015

    <arg name="fcu_url" default="udp://:14554@192.168.1.5:14555" />
    <arg name="gcs_url" default="udp://:14556@192.168.1.5:14550" />

So at least you should provide this parameters to px4.launch.

@killerlayup
Copy link
Author

@vooon
why 192.168.1.5?

@killerlayup
Copy link
Author

here is my launch file:

<launch>
    <!-- vim: ft=xml -->
    <!-- example launch script for PX4 based FCU's -->
    <arg name="gcs_url" default="udp://:14556@192.168.1.100:14550" /> 
    <arg  name="fcu_url" default="udp://:14554@192.168.1.100:14555" />
    <arg name="tgt_system" default="1" />
    <arg name="tgt_component" default="1" />

    <include file="$(find mavros)/launch/node.launch">
        <arg name="blacklist_yaml" value="$(find mavros)/launch/px4_blacklist.yaml" />
        <arg name="config_yaml" value="$(find mavros)/launch/px4_config.yaml" />

        <arg name="fcu_url" value="$(arg fcu_url)" />
        <arg name="gcs_url" value="$(arg gcs_url)" />
        <arg name="tgt_system" value="$(arg tgt_system)" />
        <arg name="tgt_component" value="$(arg tgt_component)" />
    </include>
</launch>

Is there something wrong?

@killerlayup
Copy link
Author

@v01d
@liamstask
@claymation
@dagar
I really need help, anyone help me :(

@vooon
Copy link
Member

vooon commented Oct 29, 2015

Perhaps there may be localhost, not sure on what IP jMAVSim binds.
I recommend to use px4.launch fcu_url:=<url> gcs_url:=<url>, script from manual little outdated (before i added whitelist).
Or you can do your own:

<launch>
<include file="$(find mavros)/launch/px4.launch">
<arg name="fcu_url" value="<url>" />
<arg name="gcs_url" value="<url>" />
</include>
</launch>

Anyway your mavros looks outdated (something about version 0.8-0.9), i recommend to upgrade
because there lots of bugs fixed and specially with setpoint plugins.

Next check with netstat does simulator listening on fcu port (:14550).
Note that you can connect with QGC directly to that port - check that problem in mavros.

@killerlayup
Copy link
Author

@vooon
hi, I update my ubuntu to 14.04 and ros to indigo,and update the mavros too.
but I still can't fix this issue.

Meanwhile, when I connect pixhawk via serial port and run:

roslaunch mavros px4.launch 

it can be connected as it shows:

[ INFO] [1446334866.819164422]: MAVROS started. MY ID [1, 240], TARGET ID [1, 1]
[ WARN] [1446334866.909027438]: TM: Clock skew detected (-9223372036.854730606 s). Hard syncing clocks.
[ INFO] [1446334867.796013881]: CON: Got HEARTBEAT, connected.
[ WARN] [1446334869.797809052]: VER: broadcast request timeout, retries left 4
[ WARN] [1446334870.797978701]: VER: broadcast request timeout, retries left 3
[ WARN] [1446334871.797738623]: VER: unicast request timeout, retries left 2
[ WARN] [1446334872.797911530]: VER: unicast request timeout, retries left 1
[ WARN] [1446334873.797571743]: VER: unicast request timeout, retries left 0
[ WARN] [1446334874.798431048]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities
[ WARN] [1446334878.208535680]: TM: Clock skew detected (9223372036.854656219 s). Hard syncing clocks.

BUT when I run

rosrun mavros mavsys mode -c OFFBOARD

it shows:

[ERROR] [1446334878.497378022]: MODE: Unsupported FCU

why does this happened? Can you help me?

Thanks a lot

@vooon
Copy link
Member

vooon commented Oct 31, 2015

Because:

      - 
        key: Autopilot type
        value: 0

0 - Generic - modes unknown. We support only APM (ArduPilotMega) and PX4 firmwares.
Also check that with recent version "Autopilot type" should be string.

@killerlayup
Copy link
Author

hi, @vooon

here is log when I run 'rostopic echo -n1 /diagnostics'

# joel@joel-X450VC:~/catkin_ws$ rostopic echo -n1 /diagnostics
header: 
  seq: 23
  stamp: 
    secs: 1446401626
    nsecs: 611840330
  frame_id: ''
status: 
  - 
    level: 1
    name: mavros: FCU connection
    message: not connected
    hardware_id: udp://:14554@192.168.1.126:14555
    values: 
      - 
        key: Received packets:
        value: 0
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 0
      - 
        key: Tx sequence number:
        value: 25
      - 
        key: Rx total bytes:
        value: 0
      - 
        key: Tx total bytes:
        value: 425
      - 
        key: Rx speed:
        value: 0.000000
      - 
        key: Tx speed:
        value: 17.000000
  - 
    level: 2
    name: mavros: GPS
    message: No satellites
    hardware_id: udp://:14554@192.168.1.126:14555
    values: 
      - 
        key: Satellites visible
        value: 0
      - 
        key: Fix type
        value: 0
      - 
        key: EPH (m)
        value: Unknown
      - 
        key: EPV (m)
        value: Unknown
  - 
    level: 2
    name: mavros: Heartbeat
    message: No events recorded.
    hardware_id: udp://:14554@192.168.1.126:14555
    values: 
      - 
        key: Heartbeats since startup
        value: 0
      - 
        key: Frequency (Hz)
        value: 0.000000
      - 
        key: Vehicle type
        value: Generic
      - 
        key: Autopilot type
        value: Generic
      - 
        key: Mode
        value: ''
      - 
        key: System status
        value: Uninit
  - 
    level: 0
    name: mavros: System
    message: Normal
    hardware_id: udp://:14554@192.168.1.126:14555
    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: 2
    name: mavros: Battery
    message: No data
    hardware_id: udp://:14554@192.168.1.126:14555
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        key: Current
        value: 0.0
      - 
        key: Remaining
        value: 0.0
---

So, it shows:

- 
        key: Vehicle type
        value: Generic
      - 
        key: Autopilot type
        value: Generic

But it still shows:

[ERROR] [1446334878.497378022]: MODE: Unsupported FCU

when I run

rosrun mavros mavsys mode -c OFFBOARD

I really confused.. :{

@killerlayup
Copy link
Author

anyone help???

@vooon
Copy link
Member

vooon commented Nov 2, 2015

Autopilot is still Generic. It is issue source.

@vooon
Copy link
Member

vooon commented Nov 2, 2015

And then it it not mavros but firmware side.

@killerlayup
Copy link
Author

do you mean that something is wrong with my pixhawk Firmware?
my pixhawk firmware is Firmware/stable/px4fmu-v2_default.px4 ,is that right?

@vooon
Copy link
Member

vooon commented Nov 2, 2015

Oh, i overlooked this:

  - 
    level: 1
    name: mavros: FCU connection
    message: not connected
    hardware_id: Mavlink

not connected - check your connection URL!

@killerlayup
Copy link
Author

hi @vooon
sorry to bother you again, now I can connect px4 with jMAVSim, meanwhile I can connect px4 with MAVROS,but when I start jMAVSim and MAVROS like :

                 setpoint_demo.py
                   /
QGC <-> ROS/Mavros <-> jMAVSim <-> Pixhawk

jMAVSim can't connect with Mavros, as it shows:

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/fcu_url: udp://:14554@loca...
 * /mavros/gcs_url: udp://:14556@loca...
 * /mavros/global_position/frame_id: fcu
 * /mavros/global_position/rot_covariance: 99999.0
 * /mavros/global_position/tf/child_frame_id: fcu_utm
 * /mavros/global_position/tf/frame_id: local_origin
 * /mavros/global_position/tf/send: False
 * /mavros/image/frame_id: px4flow
 * /mavros/imu/angular_velocity_stdev: 0.000349065850399
 * /mavros/imu/frame_id: fcu
 * /mavros/imu/linear_acceleration_stdev: 0.0003
 * /mavros/imu/magnetic_stdev: 0.0
 * /mavros/imu/orientation_stdev: 1.0
 * /mavros/local_position/frame_id: fcu
 * /mavros/local_position/tf/child_frame_id: fcu
 * /mavros/local_position/tf/frame_id: local_origin
 * /mavros/local_position/tf/send: False
 * /mavros/mission/pull_after_gcs: True
 * /mavros/mocap/use_pose: True
 * /mavros/mocap/use_tf: False
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.0
 * /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_throttle: False
 * /mavros/setpoint_attitude/tf/child_frame_id: attitude
 * /mavros/setpoint_attitude/tf/frame_id: local_origin
 * /mavros/setpoint_attitude/tf/listen: False
 * /mavros/setpoint_attitude/tf/rate_limit: 10.0
 * /mavros/setpoint_position/tf/child_frame_id: setpoint
 * /mavros/setpoint_position/tf/frame_id: local_origin
 * /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: 50
 * /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/vibration/frame_id: vibration
 * /mavros/vision_pose/tf/child_frame_id: vision
 * /mavros/vision_pose/tf/frame_id: local_origin
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: False
 * /rosdistro: indigo
 * /rosversion: 1.11.13

NODES
  /
    mavros (mavros/mavros_node)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[mavros-1]: started with pid [13530]
[ INFO] [1446505298.712637946]: FCU URL: udp://:14554@localhost:14555
[ INFO] [1446505298.713004909]: udp0: Bind address: 0.0.0.0:14554
[ INFO] [1446505298.713242047]: udp0: Remote address: 127.0.0.1:14555
[ INFO] [1446505298.713440589]: GCS URL: udp://:14556@localhost:14550
[ INFO] [1446505298.713641977]: udp1: Bind address: 0.0.0.0:14556
[ INFO] [1446505298.713844352]: udp1: Remote address: 127.0.0.1:14550
[ INFO] [1446505298.946339650]: Plugin 3dr_radio loaded and initialized
[ INFO] [1446505298.954673199]: Plugin actuator_control loaded and initialized
[ INFO] [1446505300.550314719]: Plugin cam_imu_sync loaded and initialized
[ INFO] [1446505300.567810750]: Plugin command loaded and initialized
[ INFO] [1446505300.567954640]: Plugin distance_sensor blacklisted
[ INFO] [1446505300.579655413]: Plugin ftp loaded and initialized
[ INFO] [1446505300.591273952]: Plugin global_position loaded and initialized
[ INFO] [1446505300.591320220]: Plugin image_pub blacklisted
[ INFO] [1446505300.599106331]: Plugin imu_pub loaded and initialized
[ INFO] [1446505300.603523387]: Plugin local_position loaded and initialized
[ INFO] [1446505300.608325412]: Plugin mocap_pose_estimate loaded and initialized
[ INFO] [1446505300.612645859]: Plugin param loaded and initialized
[ INFO] [1446505300.620907427]: Plugin px4flow loaded and initialized
[ INFO] [1446505300.624865020]: Plugin rc_io loaded and initialized
[ INFO] [1446505300.624921557]: Plugin safety_area blacklisted
[ INFO] [1446505300.628937408]: Plugin setpoint_accel loaded and initialized
[ INFO] [1446505300.642963180]: Plugin setpoint_attitude loaded and initialized
[ INFO] [1446505300.652579939]: Plugin setpoint_position loaded and initialized
[ INFO] [1446505300.655571494]: Plugin setpoint_velocity loaded and initialized
[ INFO] [1446505300.661293437]: Plugin sys_status loaded and initialized
[ INFO] [1446505300.664750819]: Plugin sys_time loaded and initialized
[ INFO] [1446505300.666107824]: Plugin vfr_hud loaded and initialized
[ INFO] [1446505300.666149993]: Plugin vibration blacklisted
[ INFO] [1446505300.675131021]: Plugin vision_pose_estimate loaded and initialized
[ INFO] [1446505300.680548481]: Plugin vision_speed_estimate loaded and initialized
[ INFO] [1446505300.684886749]: Plugin waypoint loaded and initialized
[ INFO] [1446505300.684965935]: Autostarting mavlink via USB on PX4
[ INFO] [1446505300.685026394]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1446505300.685060343]: Built-in MAVLink dialect: ardupilotmega
[ INFO] [1446505300.685151816]: MAVROS started. MY ID [1, 240], TARGET ID [1, 50]

no heartbeat! here is my launch file :

<launch>
    <!-- vim: ft=xml -->
    <!-- example launch script for PX4 based FCU's -->

    <arg name="fcu_url" default="udp://:14554@localhost:14555" />
    <arg name="gcs_url" default="udp://:14556@localhost:14550" />
    <arg name="tgt_system" default="1" />
    <arg name="tgt_component" default="50" />

    <include file="$(find mavros)/launch/node.launch">
        <arg name="config_yaml" value="$(find mavros)/launch/px4_config.yaml" />
        <arg name="pluginlists_yaml" value="$(find mavros)/launch/px4_pluginlists.yaml" />
        <arg name="fcu_url" value="$(arg fcu_url)" />
        <arg name="gcs_url" value="$(arg gcs_url)" />
        <arg name="tgt_system" value="$(arg tgt_system)" />
        <arg name="tgt_component" value="$(arg tgt_component)" />
    </include>
</launch>

it really confused me..

@killerlayup
Copy link
Author

well, I have another question, in jMAVSim, when I start jMAVSim, it can communicate with px4, but the log shows:

joel@joel-X450VC:~/jMAVSim$ java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -serial /dev/ttyACM0 921600 -qgc
Success!
3D [dev] 1.6.0-pre12-daily-experimental daily

WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.
Init MAVLink
WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.
WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.
WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.
WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.
WARNING: Got heartbeat from system #2 but configured to only accept messages from system #1. Please change the system ID parameter to match in order to use HITL/SITL.

how to fix this problem? Is that related to MAV_SYS_ID?

@vooon
Copy link
Member

vooon commented Nov 2, 2015

It is related to network connection. Until you got:

[INFO] CON: Got HEARTBEAT, connected.

There no connection. Why? Who knows... But first check what ports actually jMAVSim actually listens.
Because looks like that mavros url configured for wrong ports and because UDP is connectionless you can't check that you trying wrong address/port.

I'm not sure, perhaps there some changes in jMAVSim, check sources.

@killerlayup
Copy link
Author

hi, @vooon
now I can start jMAVSim and mavros together and mavros can get heartbeat. But I can't set mode to OFFMODE as the log says:

MSG: REJECT OFFBOARD

I read the setup at https://pixhawk.org/dev/ros/mavros_offboard:

Make sure the flight controller gets a stream of setpoints (0.5s timeout) before you switch to offboard mode. The system will reject offboard otherwise

so I follow above:

first, arm the multirotor, done
second, run ./setpoint_demo.py , done
third, use my transmitter switch to set mode OFFBOARD

but it still says:

MSG: REJECT OFFBOARD

I am really confused.

BTW, another question, when I use QGC via UDP, QGC popup window says:

Warning: A second system is using the same system id (255)

then the connection will be lost.
why did this happen? Do you have any idea?

Thanks

@killerlayup
Copy link
Author

I forget one thing, when I use the command:

rosrun mavros mavsys mode -c OFFBOARD

instead of using my transmitter switch, it shows the log on mavros terminal:

[ERROR] [1446559320.758279126]: MODE: Unsupported FCU

Do you have any idea about this?

Thanks

@vooon
Copy link
Member

vooon commented Nov 3, 2015

Please show diagnostics again.

@killerlayup
Copy link
Author

hi, @vooon

here is the diagnostics log:

header: 
  seq: 42
  stamp: 
    secs: 1446599813
    nsecs: 416201253
  frame_id: ''
status: 
  - 
    level: 0
    name: mavros: FCU connection
    message: connected
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Received packets:
        value: 1055
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 22
      - 
        key: Tx sequence number:
        value: 23
      - 
        key: Rx total bytes:
        value: 24797
      - 
        key: Tx total bytes:
        value: 24797
      - 
        key: Rx speed:
        value: 517.000000
      - 
        key: Tx speed:
        value: 517.000000
  - 
    level: 0
    name: mavros: GCS bridge
    message: connected
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Received packets:
        value: 6
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 74
      - 
        key: Tx sequence number:
        value: 0
      - 
        key: Rx total bytes:
        value: 102
      - 
        key: Tx total bytes:
        value: 24768
      - 
        key: Rx speed:
        value: 0.000000
      - 
        key: Tx speed:
        value: 517.000000
  - 
    level: 2
    name: mavros: GPS
    message: No satellites
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Satellites visible
        value: 0
      - 
        key: Fix type
        value: 0
      - 
        key: EPH (m)
        value: Unknown
      - 
        key: EPV (m)
        value: Unknown
  - 
    level: 0
    name: mavros: Heartbeat
    message: Normal
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Heartbeats since startup
        value: 47
      - 
        key: Frequency (Hz)
        value: 0.999961
      - 
        key: Vehicle type
        value: Onboard-Controller
      - 
        key: Autopilot type
        value: INVALID
      - 
        key: Mode
        value: CMODE(0)
      - 
        key: System status
        value: Active
  - 
    level: 0
    name: mavros: System
    message: Normal
    hardware_id: udp://:36895@localhost:36895
    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: 2
    name: mavros: Battery
    message: No data
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        key: Current
        value: 0.0
      - 
        key: Remaining
        value: 0.0
  - 
    level: 0
    name: mavros: Time Sync
    message: Normal
    hardware_id: udp://:36895@localhost:36895
    values: 
      - 
        key: Timesyncs since startup
        value: 270
      - 
        key: Frequency (Hz)
        value: 9.999617
      - 
        key: Last dt (ms)
        value: 0.004174
      - 
        key: Mean dt (ms)
        value: -0.000067
      - 
        key: Last system time (s)
        value: 1446599813.367889881
      - 
        key: Time offset (s)
        value: 9223372036.854730606
---

@killerlayup
Copy link
Author

do you have any free time? could I invite you to gitter?
if that bothers you, tell me :)

@vooon
Copy link
Member

vooon commented Nov 4, 2015

You may ask at mavros gitter channel.

You setted wrong UDP URL udp://:36895@localhost:36895 - nope!
MAVROS listens to itself because you setted same port for bind and remote.

So it got self heartbeat:

      - 
        key: Vehicle type
        value: Onboard-Controller
      - 
        key: Autopilot type
        value: INVALID

@vooon
Copy link
Member

vooon commented Nov 4, 2015

@DrTon there still some problem with connection. We trying to setup following scheme:

hil_mavros

@vooon
Copy link
Member

vooon commented Nov 4, 2015

strict graph {
    subgraph ros {
        graph [
            label="ROS",
            compound=True,
            lheight=0.21,
            rank=same,
            style=bold]
        node [style=filled]
        mavros;
        gcs_bridge;
    }

    "Pixhawk" -- "mavros" [label="/dev/ttyACM0:921600"]
    "mavros" -- "jMAVSim" [label="udp://:14560@localhost:14565"]
    "mavros" -- "gcs_bridge" [label="ROSUDP"]
    "gcs_bridge" -- "QGroundControl" [label="udp://:14575@localhost:14570"]
}

@killerlayup
Copy link
Author

Hi, @vooon

are you online?
last night I try it again,and only find can't set the 'OFFBOARD' mode

in mavros it shows:

[ERROR] [1446648948.318435175]: FCU: Not switching off HIL (safety)
[ERROR] [1446648948.368477778]: FCU: command temporarily rejected: 176

when I run rosrun mavros mavsys mode -c OFFBOARD

@vooon
Copy link
Member

vooon commented Nov 7, 2015

@killerlayup seems that your error with arming related to #423.

@vooon
Copy link
Member

vooon commented Nov 8, 2015

@killerlayup i fixed #423. Can you update and check?

@killerlayup
Copy link
Author

hi @vooon
yes, I will checked it, thanks

@iceicehyhy
Copy link

Hi @killerlayup,
i'm facing the same problem when establishing this framework, mavros could't get a heartbeat line when jMAVSim is used as a bridge to communicate with PX4. How did you solve the problem?

@killerlayup
Copy link
Author

Hi @iceicehyhy
follow this DrTon/jMAVSim#18

@iceicehyhy
Copy link

Hi @killerlayup , I followed the steps posted by @weiweikong, but the communication between QGC--->Mavros is not stable as I could always see " Connection Lost" . Any idea to solve this issue?
Btw, any updates for offboard control?
Thanks

@killerlayup
Copy link
Author

@iceicehyhy
hi, I have the same issue with you about communication between QGC--->Mavros, still not fixed.
But I can set OFFBOARD mode by following the step posted by @weiweikong

@killerlayup
Copy link
Author

@iceicehyhy
Hi, have you solved your issue?

@vooon
Copy link
Member

vooon commented Nov 16, 2015

@killerlayup #427 - silent.

You may try to use TCP connection method for GCS. Simply change gcs_url to tcp-l://.
Then use TCP connection in QGC to 127.0.0.1:5760.

@killerlayup
Copy link
Author

yes! it works! thanks man @vooon

@vooon
Copy link
Member

vooon commented Nov 17, 2015

Finally :) i think may close issue now.

@vooon vooon closed this as completed Nov 17, 2015
@weiweikong
Copy link

Why we here use TCP connection not UDP ? @vooon

@vooon
Copy link
Member

vooon commented Nov 17, 2015

Just to eliminate possible interference with other mavlink talker programs that uses UDP.
By default all those programs uses ports 14550 or 14555 and because of connectionless nature of UDP both ends latch remote address from sender. So it is not to hard to break connection with transmission from some component.

I wanted to make multicast UDP transport, so port problem will gone. But really nobody support that now.
And most mavros plugins note ready because they won't check sender identifications.

@iceicehyhy
Copy link

@vooon
Hi, thanks so much for the solution.
@killerlayup
Just chance gcs_url to
arg name="gcs_url" default="tcp-l://"
will make it work?

@killerlayup
Copy link
Author

@iceicehyhy yep

@iceicehyhy
Copy link

@killerlayup yes, it works. thank you!

@killerlayup
Copy link
Author

@vooon @iceicehyhy
Hi guys!
Recently I have an issue about TCP connecttion which was OK a few days ago.

when I connect via TCP, QGC popups window:

Error on link TCP. Error on socket: Connection refused.

@killerlayup
Copy link
Author

need help~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants