Commit ee43e3a9 authored by Pierre NARVOR's avatar Pierre NARVOR
Browse files

[ros] Added AcousticFix related ros messages

parent 38cf0cb8
......@@ -9,6 +9,17 @@ find_package(catkin REQUIRED COMPONENTS
catkin_package(CATKIN_DEPENDS roscpp rospy std_msgs geometry_msgs)
......@@ -27,3 +38,5 @@ target_link_libraries(seatrac_usbl_node PRIVATE
uint8 localId # this beacon
uint8 remoteId # remote beacon
uint8 content # indicates if remoteRange, remoteUsbl and/or remotePosition are valid.
uint8 msgType
float32 localYaw
float32 localPitch
float32 localRoll
float32 localDepth
float32 soundVelocity
float32 rssi # strength of received signal
AcousticFixRange remoteRange # Some information on distance to the remote beacon
AcousticFixUSBL remoteUsbl # Some information on bearing of the remote beacon
AcousticFixPosition remotePosition # Redundant with remoteRange and remoteUsbl (range and
# Usbl makes polar coordinates, position is in cartesian).
float32 easting # is called easting but is a relative position
float32 northing # is called northing but is a relative position
float32 depth # Is computed either from incomming signal angle or
# transmitted remote beacon depth. See Seatrac programming
# guide.
uint32 tickCount # number of a 16kHz timer interval count between ping request and response.
float32 time # Compensated Round-trip time in seconds
float32 dist # Distance computed from round-trip time and sound velocity (in meters)
uint8 channelCount
float32[4] rssi # received signal strength on each channel (in dB?)
float32 azimuth # In degrees
float32 elevation # In degrees
float32 fitError # Lower is better. See Seatrac programming guide.
#include <seatrac_driver/SeatracTypes.h>
#include <seatrac_usbl/AcousticFixRange.h>
#include <seatrac_usbl/AcousticFixUSBL.h>
#include <seatrac_usbl/AcousticFixPosition.h>
#include <seatrac_usbl/AcousticFix.h>
namespace narval { namespace seatrac {
inline void copy_to_ros(seatrac_usbl::AcousticFixRange& dst, const ACOFIXRANGE_T& src)
dst.tickCount = src.count;
dst.time = 1.0e-7f*src.time;
dst.dist = 0.1f*src.dist;
inline void copy_to_ros(seatrac_usbl::AcousticFixUSBL& dst, const ACOFIXUSBL_T& src)
dst.channelCount = src.channelCount;
for(int i = 0; i < dst.channelCount; i++) dst.rssi[i] = 0.1f*src.rssi[i];
dst.azimuth = 0.1f*src.azimuth;
dst.elevation = 0.1f*src.elevation;
dst.fitError = 0.01f*src.fitError;
inline void copy_to_ros(seatrac_usbl::AcousticFixPosition& dst,
dst.easting = 0.1f*src.easting;
dst.northing = 0.1f*src.northing;
dst.depth = 0.1f*src.depth;
inline void copy_to_ros(seatrac_usbl::AcousticFix& dst, const ACOFIX_T& src)
dst.localId = src.destId;
dst.remoteId = src.srcId;
dst.content = src.flags;
dst.msgType = src.msgType;
dst.localYaw = 0.1f*src.attitudeYaw;
dst.localPitch = 0.1f*src.attitudePitch;
dst.localRoll = 0.1f*src.attitudeRoll;
dst.localDepth = 0.1f*src.depthLocal;
dst.soundVelocity = 0.1f*src.vos;
dst.rssi = 0.1f*src.rssi;
copy_to_ros(dst.remoteRange, src.range);
copy_to_ros(dst.remoteUsbl, src.usbl);
copy_to_ros(dst.remotePosition, src.position);
......@@ -15,6 +15,8 @@ using namespace Eigen;
using namespace narval::seatrac;
namespace seatrac_msgs = narval::seatrac::messages;
#include "conversions.h"
template <typename T>
void print(const uint8_t* data)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment