Add acoustic range features, including node that publishes acoustic range automatically for pings (with sim and hardware support)
New Features / Improvements
- Lowered the log verbosity for
tdma_advanced - Added mechanism to
tdma_nodefor caching the rosnode log level during init (then available to subclasses) - New message
AcousticRange.msg-
modem_sim_node.pywill automatically publishAcousticRange.msgusingdistanceandowttfrom the simulator to calculatespeed_of_sound. -
modem_sim_node.pywill automatically publishAcousticRange.msgon the topic:~acoustic_rangee.g.,modem_sim_node/acoustic_range,<private_node_ns>/acoustic_rangefor 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_replyand publishesAcousticRange.msgon~acoustic_range_topic,default=acoustic_range. - Listens on
~ping_transponders_reply_topic,default=ping_transponders_replyand publishesAcousticRange.msgon~acoustic_range_topic,default=acoustic_range.
- Listens on
- Calculates acoustic
range_mwith rosparam~sound_speed. - Can update the
sound_speeddynamically.-
~sound_speed_topic,default=ctdwhen a msg of any type (AnyMsg) is published on~sound_speed_topic, we use themsg.sound_speedfield (if it has it) to update thesound_speedvalue. - Once the
sound_speedhas been updated this way, we track the last update and age out thesound_speedafter~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_INVALIDrather thanSPEED_OF_SOUND_SOURCE_TOPIC - Can update
sound_speedmanually by publishing astd_msgs/Float32to a topic named with rosparam~manual_sound_speed_topic(default=~manual_sound_speed). the node treats these updates the same ason_sound_speed_update()
-
- Generates a TWTT range for every ping reply (modem ping OR remus transponder ping) using OWTT and
Bugfixes
-
modem_sim_node.py:- modem location topic name now uses the rosparam
~modem_location_topic. It was hard coded tolocation.
- modem location topic name now uses the rosparam
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