ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

What are the configurations I need to set for mavros_extras distance_sensor plugin?

asked 2017-01-27 15:16:20 -0500

janindu gravatar image

updated 2017-01-27 15:17:05 -0500

Hello,

In my hexacoptor setup, the Lidarlite is directly connected to a Pixhawk FCU. The Pixhawk is connected to a single board computer on the hexacoptor.

My mavros launch file looks like this :

<launch>
  <arg name="fcu_url" default="serial:///dev/ttyTHS2:57600" />
  <arg name="gcs_url" default="udp://localhost:14556@localhost:14540" />
  <arg name="tgt_system" default="1" />
  <arg name="tgt_component" default="50" />
  <arg name="pluginlists_yaml" default="$(find mbzirc_system)/launch/field_tests/px4_pluginlists.yaml"/>
  <arg name="config_yaml" default="$(find mbzirc_system)/launch/field_tests/px4_config.yaml" />

  <node name="uav_control" pkg="control" type="mavros_control" output="screen">
    <param name="autopilot" value="apm" />
  </node>
  <node name="mavros" pkg="mavros" type="mavros_node" output="screen">
    <param name="fcu_url" value="$(arg fcu_url)" />
    <param name="gcs_url" value="$(arg gcs_url)" />
    <param name="target_system_id" value="$(arg tgt_system)" />
    <param name="target_component_id" value="$(arg tgt_component)" />

    <!-- <rosparam command="load" file="$(find mavros)/launch/px4_blacklist.yaml" /> -->

    <!-- enable heartbeat send and reduce timeout -->
    <param name="conn_heartbeat" value="5.0" />
    <param name="conn_timeout" value="5.0" />
    <!-- automatically start mavlink on USB -->
    <param name="startup_px4_usb_quirk" value="true" />

    <!-- load blacklist, config -->
    <rosparam command="load" file="$(arg pluginlists_yaml)" />
    <rosparam command="load" file="$(arg config_yaml)" />
  </node>
</launch>

My px4_config.yaml looks like this:

# Common configuration for PX4 autopilot
#
# node:
startup_px4_usb_quirk: true

# --- system plugins ---

# sys_status & sys_time connection options
conn:
  heartbeat_rate: 1.0    # send hertbeat rate in Hertz
  timeout: 10.0          # hertbeat timeout in seconds
  timesync_rate: 10.0    # TIMESYNC rate in Hertz (feature disabled if 0.0)
  system_time_rate: 1.0  # send system time to FCU rate in Hertz (disabled if 0.0)

# sys_status
sys:
  min_voltage: 10.0   # diagnostics min voltage
  disable_diag: false # disable all sys_status diagnostics, except heartbeat

# sys_time
time:
  time_ref_source: "fcu"  # time_reference source
  timesync_avg_alpha: 0.6 # timesync averaging factor

# --- mavros plugins (alphabetical order) ---

# 3dr_radio
tdr_radio:
  low_rssi: 40  # raw rssi lower level for diagnostics

# actuator_control
# None

# command
cmd:
  use_comp_id_system_control: false # quirk for some old FCUs

# dummy
# None

# ftp
# None

# global_position
global_position:
  frame_id: "fcu"           # pose and fix frame_id
  rot_covariance: 99999.0   # covariance for attitude?
  tf:
    send: false               # send TF?
    frame_id: "local_origin"  # TF frame_id
    child_frame_id: "fcu_utm" # TF child_frame_id

# imu_pub
imu:
  frame_id: "fcu"
  # need find actual values
  linear_acceleration_stdev: 0.0003
  angular_velocity_stdev: !degrees 0.02
  orientation_stdev: 1.0
  magnetic_stdev: 0.0

# local_position
local_position:
  frame_id: "fcu"
  tf:
    send: false
    frame_id: "local_origin"
    child_frame_id: "fcu"
    send_fcu: false

# param
# None, used for FCU params

# rc_io
# None

# safety_area
safety_area:
  p1: {x:  1.0, y:  1.0, z:  1.0}
  p2: {x: -1.0, y: -1.0, z: -1.0}

# setpoint_accel
setpoint_accel:
  send_force: false

# setpoint_attitude
setpoint_attitude:
  reverse_throttle: false   # allow reversed throttle
  tf:
    listen: false           # enable tf listener (disable topic subscribers)
    frame_id: "local_origin"
    child_frame_id: "attitude"
    rate_limit: 10.0

# setpoint_position
setpoint_position:
  tf:
    listen: false           # enable tf listener (disable topic subscribers)
    frame_id: "local_origin"
    child_frame_id: "setpoint"
    rate_limit: 50.0

# setpoint_velocity
# None

# vfr_hud
# None

# waypoint
mission:
  pull_after_gcs: true  # update mission if gcs updates

# --- mavros extras plugins (same order) ---

# distance_sensor (PX4 only)
distance_sensor:
  hrlv_ez4_pub:
    id: 0
    frame_id: "hrlv_ez4_sonar"
    orientation: ROLL_180 # RPY:{180.0, 0.0, 0.0}
    field_of_view: 0.0  # XXX TODO
    send_tf: true
    sensor_position: {x:  0.0, y:  0.0, z:  -0.1}
  lidarlite_pub:
    id: 1
    frame_id: "lidarlite_laser"
    orientation: ROLL_180
    field_of_view ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-30 19:20:27 -0500

vooon gravatar image

APM do not support DISTANCE_SENSOR message => plugin don't do anything. APM has it's own specific message that carries ground radar data. You should write plugin.

Why you use PX4-specific configs with APM firmware?

edit flag offensive delete link more

Comments

I fooled around with PX4 specific configs. Thank you! Gonna start writing a plugin myself. Thanks!

janindu gravatar image janindu  ( 2017-01-31 12:47:57 -0500 )edit

Could you please link or refer to any guidelines by designing the Ardupilot configs and how to write it?

hesham gravatar image hesham  ( 2021-07-22 17:03:07 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-01-27 15:16:20 -0500

Seen: 1,707 times

Last updated: Jan 30 '17