Skip to content

Add acoustic range features, including node that publishes acoustic range automatically for pings (with sim and hardware support)

Caileigh Fitzgerald requested to merge dev/acoustic_range_sim into devel

New Features / Improvements

  • Lowered the log verbosity for tdma_advanced
  • Added mechanism to tdma_node for caching the rosnode log level during init (then available to subclasses)
  • New message AcousticRange.msg
    • modem_sim_node.py will automatically publish AcousticRange.msg using distance and owtt from the simulator to calculate speed_of_sound.
    • modem_sim_node.py will automatically publish AcousticRange.msg on the topic: ~acoustic_range e.g., modem_sim_node/acoustic_range, <private_node_ns>/acoustic_range for every reception.
  • New node acoustic_range_node.py
    • Generates a TWTT range for every ping reply (modem ping OR remus transponder ping) using OWTT and ~sound_speed
      • Listens on ~ping_reply_topic, default=ping_reply and publishes AcousticRange.msg on ~acoustic_range_topic, default=acoustic_range.
      • Listens on ~ping_transponders_reply_topic, default=ping_transponders_reply and publishes AcousticRange.msg on ~acoustic_range_topic, default=acoustic_range.
    • Calculates acoustic range_m with rosparam ~sound_speed.
    • Can update the sound_speed dynamically.
      • ~sound_speed_topic, default=ctd when a msg of any type (AnyMsg) is published on ~sound_speed_topic, we use the msg.sound_speed field (if it has it) to update the sound_speed value.
      • Once the sound_speed has been updated this way, we track the last update and age out the sound_speed after ~sound_speed_max_age_sec, default=500.
      • When we haven't gotten an update in more than ~sound_speed_max_age_sec, AcousticRange.speed_of_sound_source == SPEED_OF_SOUND_SOURCE_INVALID rather than SPEED_OF_SOUND_SOURCE_TOPIC
      • Can update sound_speed manually by publishing a std_msgs/Float32 to a topic named with rosparam ~manual_sound_speed_topic (default=~manual_sound_speed). the node treats these updates the same as on_sound_speed_update()

Bugfixes

  • modem_sim_node.py:
    • modem location topic name now uses the rosparam ~modem_location_topic. It was hard coded to location.

Example

$ rostopic echo /modem0/modem_sim_node/acoustic_range
#
# * built into the modem_sim_node:
#   echo the acoustic range generated by the modem_sim_node (run with test_tdma_auto_ping.launch)
#   modem0 is set to auto ping modem1 every 6 seconds in this example. This range is from a sim ping
#
header: 
  seq: 1
  stamp: 
    secs: 27
    nsecs: 839999999
  frame_id: ''
measurement_type: 2      # MEASUREMENT_TYPE_TWTT, if packet MEASUREMENT_TYPE_OWTT
speed_of_sound_source: 3 # SPEED_OF_SOUND_SOURCE_INVERTED_FROM_DISTANCE (for sim, it will always be this)
src: 1
dest: 0
owtt: 1.3184975385665894
tat: 0.0
range_m: 1977.74609375
speed_of_sound_ms: 1499.9998779296875
cst: 
...
---
$ rostopic echo /modem0/acoustic_range
#
# * using the new acoustic_range_node:
#   echo the acoustic range generated by new acoustic_range_node (run with test_tdma_auto_ping.launch)
#   sound_speed passed from launch was 1480
#
header: 
  seq: 3
  stamp: 
    secs: 120
    nsecs: 659999999
  frame_id: ''
measurement_type: 2      # MEASUREMENT_TYPE_TWTT (only type that acoustic_range_node handles currently)
speed_of_sound_source: 1 # SPEED_OF_SOUND_SOURCE_STATIC (will start this way then go to SPEED_OF_SOUND_SOURCE_TOPIC when updated then SPEED_OF_SOUND_SOURCE_INVALID if aged out)
src: 1
dest: 0
owtt: 5.0
tat: 0.0
range_m: 7400.0
speed_of_sound_ms: 1480.0
cst: 
...
---
Edited by Caileigh Fitzgerald

Merge request reports

Loading