Go to the documentation of this file.
32 #include <Eigen/Geometry>
89 static_cast<std::string
>(
"imu"));
91 static_cast<std::string
>(
"base_link"));
93 static_cast<std::string
>(
"vsm"));
95 static_cast<std::string
>(
"aux1"));
99 static_cast<std::string
>(
"odom"));
107 static_cast<std::string
>(
""));
112 static_cast<uint32_t
>(921600));
114 static_cast<std::string
>(
"off"));
116 static_cast<uint32_t
>(0));
118 static_cast<std::string
>(
""));
120 static_cast<uint32_t
>(0));
122 static_cast<std::string
>(
""));
124 static_cast<std::string
>(
""));
127 static_cast<std::string
>(
""));
130 static_cast<std::string
>(
"gnss"));
136 " use either gnss or ins.");
145 "Both UDP and TCP have been defined to receive data, only TCP will be used. If UDP is intended, leave tcp/ip_server empty.");
150 static_cast<uint32_t
>(1000));
156 "Please specify a valid polling period for PVT-related SBF blocks and NMEA messages.");
160 static_cast<uint32_t
>(1000));
166 "Please specify a valid polling period for PVT-unrelated SBF blocks and NMEA messages.");
224 "Only one of the tfs may be published at once, just activating tf in ECEF ");
239 if (
getUint32Param(
"ant_serial_nr", sn_tmp,
static_cast<uint32_t
>(0)))
249 static_cast<uint32_t
>(0)))
261 bool getConfigFromTf;
262 param(
"get_spatial_config_from_tf", getConfigFromTf,
false);
280 Eigen::Matrix3d C_imu_vehicle =
284 Eigen::Affine3d T_poi_imuWrtVeh =
286 Eigen::Affine3d T_vsm_imuWrtVeh =
288 Eigen::Affine3d T_ant_imuWrtVeh =
292 double roll, pitch, yaw;
293 getRPY(T_imu_vehicle.transform.rotation, roll, pitch, yaw);
317 Eigen::Affine3d T_aux1_imuWrtVeh =
321 double dy = T_aux1_imuWrtVeh.translation()[1] -
322 T_ant_imuWrtVeh.translation()[1];
323 double dx = T_aux1_imuWrtVeh.translation()[0] -
324 T_ant_imuWrtVeh.translation()[0];
327 double dz = T_aux1_imuWrtVeh.translation()[2] -
328 T_ant_imuWrtVeh.translation()[2];
346 double dy = T_aux1_vehicle.transform.translation.y -
347 T_ant_vehicle.transform.translation.y;
348 double dx = T_aux1_vehicle.transform.translation.x -
349 T_ant_vehicle.transform.translation.x;
352 double dz = T_aux1_vehicle.transform.translation.z -
353 T_ant_vehicle.transform.translation.z;
402 std::numeric_limits<double>::epsilon())
408 "Pitch angle output by topic /atteuler is a tilt angle rotated by " +
416 "Pitch angle output by topic /pose is a tilt angle rotated by " +
434 std::string(
"auto"));
447 "If tf shall be published, ins_use_poi has to be set to true! It is set automatically to true.");
453 for (uint8_t i = 1; i < 4; ++i)
456 std::string ntrip =
"ntrip_" + std::to_string(i);
458 param(
"rtk_settings/" + ntrip +
"/id", ntripSettings.
id, std::string());
459 if (ntripSettings.
id.empty())
462 param(
"rtk_settings/" + ntrip +
"/caster", ntripSettings.
caster,
465 ntripSettings.
caster_port,
static_cast<uint32_t
>(0));
466 param(
"rtk_settings/" + ntrip +
"/username", ntripSettings.
username,
468 if (!
param(
"rtk_settings/" + ntrip +
"/password", ntripSettings.
password,
473 static_cast<uint32_t
>(0));
474 ntripSettings.
password = std::to_string(pwd_tmp);
476 param(
"rtk_settings/" + ntrip +
"/mountpoint", ntripSettings.
mountpoint,
478 param(
"rtk_settings/" + ntrip +
"/version", ntripSettings.
version,
480 param(
"rtk_settings/" + ntrip +
"/tls", ntripSettings.
tls,
false);
481 if (ntripSettings.
tls)
482 param(
"rtk_settings/" + ntrip +
"/fingerprint",
484 param(
"rtk_settings/" + ntrip +
"/rtk_standard",
486 param(
"rtk_settings/" + ntrip +
"/send_gga", ntripSettings.
send_gga,
487 std::string(
"auto"));
490 param(
"rtk_settings/" + ntrip +
"/keep_open", ntripSettings.
keep_open,
496 for (uint8_t i = 1; i < 6; ++i)
499 std::string ips =
"ip_server_" + std::to_string(i);
501 param(
"rtk_settings/" + ips +
"/id", ipSettings.
id, std::string(
""));
502 if (ipSettings.
id.empty())
506 static_cast<uint32_t
>(0));
508 std::string(
"auto"));
509 param(
"rtk_settings/" + ips +
"/send_gga", ipSettings.
send_gga,
510 std::string(
"auto"));
513 param(
"rtk_settings/" + ips +
"/keep_open", ipSettings.
keep_open,
true);
518 for (uint8_t i = 1; i < 6; ++i)
521 std::string serial =
"serial_" + std::to_string(i);
523 param(
"rtk_settings/" + serial +
"/port", serialSettings.
port,
525 if (serialSettings.
port.empty())
529 serialSettings.
baud_rate,
static_cast<uint32_t
>(115200));
530 param(
"rtk_settings/" + serial +
"/rtk_standard",
532 param(
"rtk_settings/" + serial +
"/send_gga", serialSettings.
send_gga,
533 std::string(
"auto"));
534 if (serialSettings.
send_gga.empty())
536 param(
"rtk_settings/" + serial +
"/keep_open", serialSettings.
keep_open,
544 std::string tempString;
547 param(
"ntrip_settings/mode", tempString, std::string(
""));
548 if (tempString !=
"")
551 "Deprecation warning: parameter ntrip_settings/mode has been removed, see README under section rtk_settings.");
552 param(
"ntrip_settings/caster", tempString, std::string(
""));
553 if (tempString !=
"")
556 "Deprecation warning: parameter ntrip_settings/caster has been removed, see README under section rtk_settings.");
557 param(
"ntrip_settings/rx_has_internet", tempBool,
false);
561 "Deprecation warning: parameter ntrip_settings/rx_has_internet has been removed, see README under section rtk_settings.");
562 param(
"ntrip_settings/rx_input_corrections_tcp", tempInt, 0);
566 "Deprecation warning: parameter ntrip_settings/rx_input_corrections_tcp has been removed, see README under section rtk_settings.");
567 param(
"ntrip_settings/rx_input_corrections_serial", tempString,
569 if (tempString !=
"")
572 "Deprecation warning: parameter ntrip_settings/rx_input_corrections_serial has been removed, see README under section rtk_settings.");
581 "AttEuler needs multi-antenna receiver. Multi-antenna setting automatically activated. Deactivate publishing of AttEuler if multi-antenna operation is not available.");
591 std::string ipid =
"IPS5";
593 bool ins_use_vsm =
false;
599 " -> VSM input will not be used!");
608 static_cast<uint32_t
>(24786));
609 param(
"ins_vsm/ip_server/keep_open",
613 "velocity sensor measurements via ip_server will be used.");
617 }
else if (ins_use_vsm)
621 "no ins_vsm.ip_server.id set -> VSM input will not be used!");
631 static_cast<uint32_t
>(115200));
635 "velocity sensor measurements via serial will be used.");
639 std::vector<bool>());
644 [](
bool v) { return !v; }))
649 "all elements of ins_vsm/ros/config have been set to false -> VSM input will not be used!");
652 param(
"ins_vsm/ros/variances_by_parameter",
656 param(
"ins_vsm/ros/variances",
658 std::vector<double>());
663 "ins_vsm/ros/variances has to be of size 3 for var_x, var_y, and var_z -> VSM input will not be used!");
676 "ins_vsm/ros/config of element " +
678 " has been set to be used but its variance is not > 0.0 -> its VSM input will not be used!");
685 [](
bool v) { return !v; }))
691 "all elements of ins_vsm/ros/config have been set to false due to invalid covariances -> VSM input will not be used!");
695 }
else if (ins_use_vsm)
700 "ins_vsm/ros/config has to be of size 3 to signal wether to use v_x, v_y, and v_z -> VSM input will not be used!");
713 boost::regex(
"(tcp)://(.+):(\\d+)")))
718 }
else if (boost::regex_match(
720 boost::regex(
"(file_name):(/|(?:/[\\w-]+)+.sbf)")))
726 }
else if (boost::regex_match(
728 boost::regex(
"(file_name):(/|(?:/[\\w-]+)+.pcap)")))
735 boost::regex(
"(serial):(.+)")))
737 std::string proto(match[2]);
746 std::stringstream ss;
747 ss <<
"Device is unsupported. Perhaps you meant 'tcp://host:port' or 'file_name:xxx.sbf' or 'serial:/path/to/device'?";
771 return ((period == 0) || ((period == 5 &&
isIns)) || (period == 10) ||
772 (period == 20) || (period == 40) || (period == 50) ||
773 (period == 100) || (period == 200) || (period == 500) ||
774 (period == 1000) || (period == 2000) || (period == 5000) ||
775 (period == 10000) || (period == 15000) || (period == 30000) ||
776 (period == 60000) || (period == 120000) || (period == 300000) ||
777 (period == 600000) || (period == 900000) || (period == 1800000) ||
778 (period == 3600000));
782 const std::string& sourceFrame,
797 sourceFrame +
" to " + targetFrame +
798 ": " + ex.what() +
".");
807 Eigen::Quaterniond q(qm.w, qm.x, qm.y, qm.z);
808 Eigen::Quaterniond::RotationMatrixType C = q.matrix();
810 roll = std::atan2(C(2, 1), C(2, 2));
811 pitch = std::asin(-C(2, 0));
812 yaw = std::atan2(C(1, 0), C(0, 0));
821 int main(
int argc,
char** argv)
823 ros::init(argc, argv,
"septentrio_gnss");
Osnma osnma
OSNMA settings.
bool publish_pose
Whether or not to publish the PoseWithCovarianceStampedMsg message.
bool publish_attcoveuler
Whether or not to publish the AttCovEulerMsg message.
std::string serial_port
VSM serial port.
std::string ins_initial_heading
For heading computation when unit is powered-cycled.
bool latency_compensation
Wether processing latency shall be compensated for in ROS timestamp.
void registerSubscriber()
bool keep_open
Wether OSNMA shall be kept open on shutdown.
bool publish_imusetup
Whether or not to publish the IMUSetupMsg message.
bool publish_twist
Whether or not to publish the TwistWithCovarianceStampedMsg message.
std::string local_frame_id
Frame id of the local frame to be inserted.
std::string id
Id of the NTRIP port.
bool publish_localization
Whether or not to publish the LocalizationMsg message.
float pos_std_dev
Position deviation mask.
std::vector< RtkSerial > serial
io::CommunicationCore IO_
Handles communication with the Rx.
std::string login_password
Password for login.
bool ip_server_keep_open
Wether VSM shall be kept open om shutdown.
std::string ros_source
VSM source for INS.
std::vector< bool > ros_config
Whether or not to use individual elements of 3D velocity (v_x, v_y, v_z)
bool publish_pvtcartesian
std::string udp_ip_server
UDP IP server id.
void checkUniquenssOfIps(ROSaicNodeBase *node, const Settings &settings)
std::string ip_server
VSM IP server id.
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
This class represents the ROsaic node, to be extended..
bool insert_local_frame
Wether local frame should be inserted into tf.
bool publish_pvtgeodetic
Whether or not to publish the PVTGeodeticMsg message.
double heading_offset
Attitude offset determination in longitudinal direction.
void log(log_level::LogLevel logLevel, const std::string &s) const
Log function to provide abstraction of ROS loggers.
void getTransform(const std::string &targetFrame, const std::string &sourceFrame, TransformStampedMsg &T_s_t) const
Gets transforms from tf2.
bool publish_gpgga
Whether or not to publish the GGA message.
bool keep_open
Wether RTK connections shall be kept open on shutdown.
bool publish_imu
Whether or not to publish the ImuMsg message.
std::string ntp_server
Server for NTP synchronization.
uint32_t baud_rate
Baud rate of the serial port on which Rx receives the corrections.
double wrapAngle180to180(double angle)
Wraps an angle between -180 and 180 degrees.
geometry_msgs::msg::Quaternion QuaternionMsg
bool multi_antenna
INS multiantenna.
double vsm_x
INS velocity sensor lever arm x-offset.
uint32_t udp_port
UDP port.
bool validPeriod(uint32_t period, bool isIns) const
Checks if the period has a valid value.
void autoPublish(ROSaicNodeBase *node, Settings &settings)
void checkUniquenssOfIpsVsm(ROSaicNodeBase *node, const Settings &settings)
uint32_t serial_baud_rate
VSM serial baud rate.
bool ntp_server
Wether NTP server shall be activated.
float delta_n
Marker-to-ARP offset in the northward direction.
uint32_t polling_period_pvt
Polling period for PVT-related SBF blocks.
std::string mode
OSNMA mode.
bool tls
Wether to use TLS.
std::string datum
Datum to be used.
std::string frame_id
The frame ID used in the header of every published ROS message.
device_type::DeviceType device_type
Device type.
double theta_z
IMU orientation z-angle.
std::string send_gga
Whether (and at which rate) or not to send GGA to the serial port.
bool publish_gpst
Whether or not to publish the TimeReferenceMsg message with GPST.
double poi_y
INS POI offset in y-dimension.
bool activate_debug_log
Set logger level to DEBUG.
bool publish_galauthstatus
Whether or not to publish the GALAuthStatus message and diagnostics.
ROSCONSOLE_DECL bool set_logger_level(const std::string &name, levels::Level level)
bool publish_velcovcartesian
bool publish_aimplusstatus
double poi_x
INS POI offset in x-dimension.
std::unique_ptr< tf2_ros::TransformListener > tfListener_
void sendVelocity(const std::string &velNmea)
Hands over NMEA velocity message over to the send() method of manager_.
std::string tcp_ip_server
TCP IP server id.
double theta_x
IMU orientation x-angle.
bool publish_velsensorsetup
Whether or not to publish the VelSensorSetupMsg message.
int main(int argc, char **argv)
double theta_y
IMU orientation y-angle.
std::string ant_aux1_serial_nr
Serial number of your particular Aux1 antenna.
std::string send_gga
Whether (and at which rate) or not to send GGA to the NTRIP caster.
std::string fingerprint
Self-signed certificate fingerprint.
bool publish_exteventinsnavcart
Whether or not to publish the ExtEventINSNavCartMsg message.
bool publish_gpsfix
Whether or not to publish the GpsFixMsg message.
bool publish_gpgsa
Whether or not to publish the GSA message.
std::string vsm_frame_id
The frame ID of the velocity sensor.
uint32_t baudrate
Baudrate.
bool publish_velcovgeodetic
bool getUint32Param(const std::string &name, uint32_t &val, uint32_t defaultVal)
Gets an integer or unsigned integer value from the parameter server.
std::string caster
Hostname or IP address of the NTRIP caster to connect to.
bool ptp_server_clock
Wether PTP grandmaster clock shall be activated.
uint32_t tcp_port
TCP port.
bool publish_poscovgeodetic
double vsm_y
INS velocity sensor lever arm y-offset.
bool publish_tf_ecef
Whether or not to publish the tf of the localization.
bool publish_basevectorcart
void sendVelocity(const std::string &velNmea)
Send velocity to communication layer (virtual)
std::vector< RtkNtrip > ntrip
bool serial_keep_open
Wether VSM shall be kept open om shutdown.
bool keep_open
Wether RTK connections shall be kept open on shutdown.
uint32_t caster_port
IP port number of NTRIP caster to connect to.
double vsm_z
INS velocity sensor lever arm z-offset.
bool use_ros_axis_orientation
ROS axis orientation, body: front-left-up, geographic: ENU.
double pitch_offset
Attitude offset determination in latitudinal direction.
std::string ant_aux1_type
bool publish_localization_ecef
Whether or not to publish the LocalizationMsg message.
bool isIns()
Check if Rx is INS.
float delta_u
Marker-to-ARP offset in the upward direction.
bool ins_use_poi
INS solution reference point.
std::string ant_serial_nr
Serial number of your particular Main antenna.
bool getROSParams()
Gets the node parameters from the ROS Parameter Server, parts of which are specified in a YAML file.
bool publish_atteuler
Whether or not to publish the AttEulerMsg message.
std::string login_user
Username for login.
bool use_stream_device
Wether to use stream device tcp.
bool lock_utm_zone
Wether the UTM zone of the localization is locked.
std::vector< double > ros_variances
Variances of the 3D velocity (var_x, var_y, var_z)
bool publish_basevectorgeod
Whether or not to publish the BaseVectorGeodMsg message.
bool publish_diagnostics
Whether or not to publish the DiagnosticArrayMsg message.
std::string imu_frame_id
The frame ID used in the header of published ROS Imu message.
geometry_msgs::msg::TransformStamped TransformStampedMsg
uint32_t polling_period_rest
Polling period for all other SBF blocks and NMEA messages.
std::string device_tcp_port
TCP port.
std::string version
NTRIP version for NTRIP service.
bool param(const std::string &name, T &val, const T &defaultVal)
Gets parameter of type T from the parameter server.
std::vector< RtkIpServer > ip_server
std::string rtk_standard
RTCM version for correction data.
double poi_z
INS POI offset in z-dimension.
Settings settings_
Settings.
Eigen::Isometry3d transformToEigen(const geometry_msgs::Transform &t)
std::string custom_commands_file
Custom commands file.
std::string username
Username for NTRIP service.
void getRPY(const QuaternionMsg &qm, double &roll, double &pitch, double &yaw) const
Gets Euler angles from quaternion message.
void checkUniquenssOfIpsPortsVsm(ROSaicNodeBase *node, const Settings &settings)
bool publish_poscovcartesian
std::string rtk_standard
RTCM version for correction data.
bool publish_insnavcart
Whether or not to publish the INSNavCartMsg message.
float delta_e
Marker-to-ARP offset in the eastward direction.
bool read_from_sbf_log
Whether or not we are reading from an SBF file.
std::string hw_flow_control
HW flow control.
InsVsm ins_vsm
INS VSM setting.
std::string rtk_standard
RTCM version for correction data.
std::string device_tcp_ip
TCP IP.
double ant_lever_z
INS antenna lever arm z-offset.
ROSCONSOLE_DECL void notifyLoggerLevelsChanged()
std::string vehicle_frame_id
The frame ID of the vehicle frame.
int32_t leap_seconds
The number of leap seconds that have been inserted into the UTC time.
bool publish_gprmc
Whether or not to publish the RMC message.
void connect()
Connects the data stream.
bool keep_open
Wether RTK connections shall be kept open on shutdown.
std::string aux1_frame_id
The frame ID of the aux1 antenna.
bool publish_navsatfix
Whether or not to publish the NavSatFixMsg message.
bool publish_tf
Whether or not to publish the tf of the localization.
std::string udp_unicast_ip
UDP unicast destination ip.
bool publish_only_valid
Wether to publish only valid messages.
float att_std_dev
Attitude deviation mask.
bool auto_publish
Wether to publish automatically for cinfigure_rx = false.
bool publish_measepoch
Whether or not to publish the MeasEpoch message.
#define ROSCONSOLE_DEFAULT_NAME
bool publish_exteventinsnavgeod
Whether or not to publish the ExtEventINSNavGeodMsg message.
void checkUniquenssOfIpsPorts(ROSaicNodeBase *node, const Settings &settings)
std::string id
The IP server id.
double ant_lever_x
INS antenna lever arm x-offset.
bool publish_extsensormeas
Whether or not to publish the ExtSensorMeasMsg message.
tf2_ros::Buffer tfBuffer_
tf2 buffer and listener
std::string mountpoint
Mountpoint for NTRIP service.
std::string device
Device.
bool ros_variances_by_parameter
Whether or not to use variance defined by ROS parameter.
bool publish_insnavgeod
Whether or not to publish the INSNavGeodMsg message.
Rtk rtk
RTK corrections settings.
std::string password
Password for NTRIP service.
std::string septentrio_receiver_type
Septentrio receiver type, either "gnss" or "ins".
virtual geometry_msgs::TransformStamped lookupTransform(const std::string &target_frame, const ros::Time &target_time, const std::string &source_frame, const ros::Time &source_time, const std::string &fixed_frame, const ros::Duration timeout) const
bool read_from_pcap
Whether or not we are reading from a PCAP file.
bool publish_gpgsv
Whether or not to publish the GSV message.
uint32_t ip_server_port
VSM tcp port.
double ant_lever_y
INS antenna lever arm y-offset.
std::string send_gga
Whether (and at which rate) or not to send GGA to the NTRIP caster.