ROSaic
Functions | Variables
rosaic_node.cpp File Reference

The heart of the ROSaic driver: The ROS node that represents it. More...

#include <septentrio_gnss_driver/node/rosaic_node.hpp>
Include dependency graph for rosaic_node.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Variables

bool g_use_gnss_time
 
bool g_publish_gpst
 Whether or not to publish the sensor_msgs::TimeReference message with GPST. More...
 
bool g_publish_navsatfix
 Whether or not to publish the sensor_msgs::NavSatFix message. More...
 
bool g_publish_gpsfix
 Whether or not to publish the gps_common::GPSFix message. More...
 
bool g_publish_pose
 Whether or not to publish the geometry_msgs::PoseWithCovarianceStamped message. More...
 
bool g_publish_diagnostics
 Whether or not to publish the diagnostic_msgs::DiagnosticArray message. More...
 
std::string g_frame_id
 The frame ID used in the header of every published ROS message. More...
 
uint32_t g_leap_seconds
 The number of leap seconds that have been inserted into the UTC time. More...
 
boost::mutex g_response_mutex
 Mutex to control changes of global variable "g_response_received". More...
 
bool g_response_received
 Determines whether a command reply was received from the Rx. More...
 
boost::condition_variable g_response_condition
 Condition variable complementing "g_response_mutex". More...
 
boost::mutex g_cd_mutex
 Mutex to control changes of global variable "g_cd_received". More...
 
bool g_cd_received
 Determines whether the connection descriptor was received from the Rx. More...
 
boost::condition_variable g_cd_condition
 Condition variable complementing "g_cd_mutex". More...
 
bool g_read_cd
 
std::string g_rx_tcp_port
 Rx TCP port, e.g. IP10 or IP11, to which ROSaic is connected to. More...
 
uint32_t g_cd_count
 Since after SSSSSSSSSSS we need to wait for second connection descriptor, we have to count the connection descriptors. More...
 
bool g_channelstatus_has_arrived_gpsfix
 For GPSFix: Whether the ChannelStatus block of the current epoch has arrived or not. More...
 
bool g_measepoch_has_arrived_gpsfix
 For GPSFix: Whether the MeasEpoch block of the current epoch has arrived or not. More...
 
bool g_dop_has_arrived_gpsfix
 For GPSFix: Whether the DOP block of the current epoch has arrived or not. More...
 
bool g_pvtgeodetic_has_arrived_gpsfix
 For GPSFix: Whether the PVTGeodetic block of the current epoch has arrived or not. More...
 
bool g_poscovgeodetic_has_arrived_gpsfix
 For GPSFix: Whether the PosCovGeodetic block of the current epoch has arrived or not. More...
 
bool g_velcovgeodetic_has_arrived_gpsfix
 For GPSFix: Whether the VelCovGeodetic block of the current epoch has arrived or not. More...
 
bool g_atteuler_has_arrived_gpsfix
 For GPSFix: Whether the AttEuler block of the current epoch has arrived or not. More...
 
bool g_attcoveuler_has_arrived_gpsfix
 For GPSFix: Whether the AttCovEuler block of the current epoch has arrived or not. More...
 
bool g_pvtgeodetic_has_arrived_navsatfix
 For NavSatFix: Whether the PVTGeodetic block of the current epoch has arrived or not. More...
 
bool g_poscovgeodetic_has_arrived_navsatfix
 For NavSatFix: Whether the PosCovGeodetic block of the current epoch has arrived or not. More...
 
bool g_pvtgeodetic_has_arrived_pose
 For PoseWithCovarianceStamped: Whether the PVTGeodetic block of the current epoch has arrived or not. More...
 
bool g_poscovgeodetic_has_arrived_pose
 For PoseWithCovarianceStamped: Whether the PosCovGeodetic block of the current epoch has arrived or not. More...
 
bool g_atteuler_has_arrived_pose
 For PoseWithCovarianceStamped: Whether the AttEuler block of the current epoch has arrived or not. More...
 
bool g_attcoveuler_has_arrived_pose
 For PoseWithCovarianceStamped: Whether the AttCovEuler block of the current epoch has arrived or not. More...
 
bool g_receiverstatus_has_arrived_diagnostics
 For DiagnosticArray: Whether the ReceiverStatus block of the current epoch has arrived or not. More...
 
bool g_qualityind_has_arrived_diagnostics
 For DiagnosticArray: Whether the QualityInd block of the current epoch has arrived or not. More...
 
std::map< std::string, uint32_t > g_GPSFixMap
 A C++ map for keeping track of the SBF blocks necessary to construct the GPSFix ROS message. More...
 
std::map< std::string, uint32_t > g_NavSatFixMap
 A C++ map for keeping track of the SBF blocks necessary to construct the NavSatFix ROS message. More...
 
std::map< std::string, uint32_t > g_PoseWithCovarianceStampedMap
 A C++ map for keeping track of SBF blocks necessary to construct the PoseWithCovarianceStamped ROS message. More...
 
std::map< std::string, uint32_t > g_DiagnosticArrayMap
 A C++ map for keeping track of SBF blocks necessary to construct the DiagnosticArray ROS message. More...
 
boost::shared_ptr< ros::NodeHandle > g_nh
 
const uint32_t g_ROS_QUEUE_SIZE = 1
 Queue size for ROS publishers. More...
 

Detailed Description

The heart of the ROSaic driver: The ROS node that represents it.

Date
22/08/20

Definition in file rosaic_node.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 747 of file rosaic_node.cpp.

References g_attcoveuler_has_arrived_gpsfix, g_attcoveuler_has_arrived_pose, g_atteuler_has_arrived_gpsfix, g_atteuler_has_arrived_pose, g_cd_count, g_cd_received, g_channelstatus_has_arrived_gpsfix, g_dop_has_arrived_gpsfix, g_frame_id, g_leap_seconds, g_measepoch_has_arrived_gpsfix, g_nh, g_poscovgeodetic_has_arrived_gpsfix, g_poscovgeodetic_has_arrived_navsatfix, g_poscovgeodetic_has_arrived_pose, g_publish_diagnostics, g_publish_gpsfix, g_publish_gpst, g_publish_navsatfix, g_publish_pose, g_pvtgeodetic_has_arrived_gpsfix, g_pvtgeodetic_has_arrived_navsatfix, g_pvtgeodetic_has_arrived_pose, g_qualityind_has_arrived_diagnostics, g_read_cd, g_receiverstatus_has_arrived_diagnostics, g_response_received, g_use_gnss_time, g_velcovgeodetic_has_arrived_gpsfix, and rosaic_node::getROSInt().

748 {
749  ros::init(argc, argv, "septentrio_gnss");
750  g_nh.reset(new ros::NodeHandle("~"));
751  g_nh->param("use_gnss_time", g_use_gnss_time, true);
752  g_nh->param("frame_id", g_frame_id, (std::string) "gnss");
753  g_nh->param("publish/gpst", g_publish_gpst, true);
754  g_nh->param("publish/navsatfix", g_publish_navsatfix, true);
755  g_nh->param("publish/gpsfix", g_publish_gpsfix, true);
756  g_nh->param("publish/pose", g_publish_pose, true);
757  g_nh->param("publish/diagnostics", g_publish_diagnostics, true);
758  rosaic_node::getROSInt("leap_seconds", g_leap_seconds, static_cast<uint32_t>(18));
759 
760  g_response_received = false;
761  g_cd_received = false;
762  g_read_cd = true;
763  g_cd_count = 0;
766  g_dop_has_arrived_gpsfix = false;
780 
781  // The info logging level seems to be default, hence we modify log level momentarily..
782  // The following is the C++ version of rospy.init_node('my_ros_node', log_level=rospy.DEBUG)
783  if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME,
784  ros::console::levels::Debug)) //debug is lowest level, shows everything
785  ros::console::notifyLoggerLevelsChanged();
786 
787  rosaic_node::ROSaicNode rx_node; // This launches everything we need, in theory :)
788  return 0;
789 }
bool g_atteuler_has_arrived_gpsfix
For GPSFix: Whether the AttEuler block of the current epoch has arrived or not.
boost::shared_ptr< ros::NodeHandle > g_nh
std::string g_frame_id
The frame ID used in the header of every published ROS message.
bool g_channelstatus_has_arrived_gpsfix
For GPSFix: Whether the ChannelStatus block of the current epoch has arrived or not.
uint32_t g_leap_seconds
The number of leap seconds that have been inserted into the UTC time.
bool g_cd_received
Determines whether the connection descriptor was received from the Rx.
bool g_dop_has_arrived_gpsfix
For GPSFix: Whether the DOP block of the current epoch has arrived or not.
bool g_attcoveuler_has_arrived_pose
For PoseWithCovarianceStamped: Whether the AttCovEuler block of the current epoch has arrived or not...
bool g_attcoveuler_has_arrived_gpsfix
For GPSFix: Whether the AttCovEuler block of the current epoch has arrived or not.
bool g_qualityind_has_arrived_diagnostics
For DiagnosticArray: Whether the QualityInd block of the current epoch has arrived or not...
bool g_publish_diagnostics
Whether or not to publish the diagnostic_msgs::DiagnosticArray message.
bool g_publish_pose
Whether or not to publish the geometry_msgs::PoseWithCovarianceStamped message.
bool g_poscovgeodetic_has_arrived_gpsfix
For GPSFix: Whether the PosCovGeodetic block of the current epoch has arrived or not.
bool g_velcovgeodetic_has_arrived_gpsfix
For GPSFix: Whether the VelCovGeodetic block of the current epoch has arrived or not.
bool getROSInt(const std::string &key, U &u)
Gets an integer or unsigned integer value from the parameter server.
bool g_read_cd
bool g_poscovgeodetic_has_arrived_navsatfix
For NavSatFix: Whether the PosCovGeodetic block of the current epoch has arrived or not...
bool g_atteuler_has_arrived_pose
For PoseWithCovarianceStamped: Whether the AttEuler block of the current epoch has arrived or not...
bool g_measepoch_has_arrived_gpsfix
For GPSFix: Whether the MeasEpoch block of the current epoch has arrived or not.
bool g_publish_navsatfix
Whether or not to publish the sensor_msgs::NavSatFix message.
bool g_pvtgeodetic_has_arrived_navsatfix
For NavSatFix: Whether the PVTGeodetic block of the current epoch has arrived or not.
bool g_publish_gpsfix
Whether or not to publish the gps_common::GPSFix message.
bool g_receiverstatus_has_arrived_diagnostics
For DiagnosticArray: Whether the ReceiverStatus block of the current epoch has arrived or not...
bool g_use_gnss_time
bool g_poscovgeodetic_has_arrived_pose
For PoseWithCovarianceStamped: Whether the PosCovGeodetic block of the current epoch has arrived or n...
This class represents the ROsaic node, to be extended..
bool g_response_received
Determines whether a command reply was received from the Rx.
bool g_pvtgeodetic_has_arrived_pose
For PoseWithCovarianceStamped: Whether the PVTGeodetic block of the current epoch has arrived or not...
bool g_publish_gpst
Whether or not to publish the sensor_msgs::TimeReference message with GPST.
uint32_t g_cd_count
Since after SSSSSSSSSSS we need to wait for second connection descriptor, we have to count the connec...
bool g_pvtgeodetic_has_arrived_gpsfix
For GPSFix: Whether the PVTGeodetic block of the current epoch has arrived or not.
Here is the call graph for this function:

Variable Documentation

◆ g_attcoveuler_has_arrived_gpsfix

bool g_attcoveuler_has_arrived_gpsfix

For GPSFix: Whether the AttCovEuler block of the current epoch has arrived or not.

Definition at line 714 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_attcoveuler_has_arrived_pose

bool g_attcoveuler_has_arrived_pose

For PoseWithCovarianceStamped: Whether the AttCovEuler block of the current epoch has arrived or not.

Definition at line 726 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_atteuler_has_arrived_gpsfix

bool g_atteuler_has_arrived_gpsfix

For GPSFix: Whether the AttEuler block of the current epoch has arrived or not.

Definition at line 712 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_atteuler_has_arrived_pose

bool g_atteuler_has_arrived_pose

For PoseWithCovarianceStamped: Whether the AttEuler block of the current epoch has arrived or not.

Definition at line 724 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_cd_condition

boost::condition_variable g_cd_condition

Condition variable complementing "g_cd_mutex".

Definition at line 691 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_cd_count

uint32_t g_cd_count

Since after SSSSSSSSSSS we need to wait for second connection descriptor, we have to count the connection descriptors.

Definition at line 698 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::next(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_cd_mutex

boost::mutex g_cd_mutex

Mutex to control changes of global variable "g_cd_received".

Definition at line 687 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_cd_received

bool g_cd_received

Determines whether the connection descriptor was received from the Rx.

Definition at line 689 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), main(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_channelstatus_has_arrived_gpsfix

bool g_channelstatus_has_arrived_gpsfix

For GPSFix: Whether the ChannelStatus block of the current epoch has arrived or not.

Definition at line 700 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_DiagnosticArrayMap

std::map<std::string, uint32_t> g_DiagnosticArrayMap

A C++ map for keeping track of SBF blocks necessary to construct the DiagnosticArray ROS message.

Definition at line 738 of file rosaic_node.cpp.

◆ g_dop_has_arrived_gpsfix

bool g_dop_has_arrived_gpsfix

For GPSFix: Whether the DOP block of the current epoch has arrived or not.

Definition at line 704 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_frame_id

std::string g_frame_id

The frame ID used in the header of every published ROS message.

Definition at line 677 of file rosaic_node.cpp.

Referenced by main(), GpgsaParser::parseASCII(), GpgsvParser::parseASCII(), GprmcParser::parseASCII(), GpggaParser::parseASCII(), and io_comm_rx::RxMessage::read().

◆ g_GPSFixMap

std::map<std::string, uint32_t> g_GPSFixMap

A C++ map for keeping track of the SBF blocks necessary to construct the GPSFix ROS message.

Definition at line 732 of file rosaic_node.cpp.

◆ g_leap_seconds

uint32_t g_leap_seconds

The number of leap seconds that have been inserted into the UTC time.

Definition at line 679 of file rosaic_node.cpp.

Referenced by main(), and io_comm_rx::timestampSBF().

◆ g_measepoch_has_arrived_gpsfix

bool g_measepoch_has_arrived_gpsfix

For GPSFix: Whether the MeasEpoch block of the current epoch has arrived or not.

Definition at line 702 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_NavSatFixMap

std::map<std::string, uint32_t> g_NavSatFixMap

A C++ map for keeping track of the SBF blocks necessary to construct the NavSatFix ROS message.

Definition at line 734 of file rosaic_node.cpp.

◆ g_nh

boost::shared_ptr<ros::NodeHandle> g_nh

Node Handle for the ROSaic node You must initialize the NodeHandle in the "main" function (or in any method called indirectly or directly by the main function). One can declare a pointer to the NodeHandle to be a global variable and then initialize it afterwards only...

Definition at line 743 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::connect(), rosaic_node::getROSInt(), rosaic_node::ROSaicNode::getROSParams(), main(), and io_comm_rx::RxMessage::read().

◆ g_poscovgeodetic_has_arrived_gpsfix

bool g_poscovgeodetic_has_arrived_gpsfix

For GPSFix: Whether the PosCovGeodetic block of the current epoch has arrived or not.

Definition at line 708 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_poscovgeodetic_has_arrived_navsatfix

bool g_poscovgeodetic_has_arrived_navsatfix

For NavSatFix: Whether the PosCovGeodetic block of the current epoch has arrived or not.

Definition at line 718 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_poscovgeodetic_has_arrived_pose

bool g_poscovgeodetic_has_arrived_pose

For PoseWithCovarianceStamped: Whether the PosCovGeodetic block of the current epoch has arrived or not.

Definition at line 722 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_PoseWithCovarianceStampedMap

std::map<std::string, uint32_t> g_PoseWithCovarianceStampedMap

A C++ map for keeping track of SBF blocks necessary to construct the PoseWithCovarianceStamped ROS message.

Definition at line 736 of file rosaic_node.cpp.

◆ g_publish_diagnostics

bool g_publish_diagnostics

Whether or not to publish the diagnostic_msgs::DiagnosticArray message.

Definition at line 675 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), rosaic_node::ROSaicNode::defineMessages(), io_comm_rx::CallbackHandlers::handle(), main(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_publish_gpsfix

bool g_publish_gpsfix

◆ g_publish_gpst

bool g_publish_gpst

Whether or not to publish the sensor_msgs::TimeReference message with GPST.

Definition at line 667 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::defineMessages(), io_comm_rx::CallbackHandlers::handle(), and main().

◆ g_publish_navsatfix

bool g_publish_navsatfix

Whether or not to publish the sensor_msgs::NavSatFix message.

Definition at line 669 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::defineMessages(), io_comm_rx::CallbackHandlers::handle(), main(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_publish_pose

bool g_publish_pose

Whether or not to publish the geometry_msgs::PoseWithCovarianceStamped message.

Definition at line 673 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::defineMessages(), io_comm_rx::CallbackHandlers::handle(), main(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_pvtgeodetic_has_arrived_gpsfix

bool g_pvtgeodetic_has_arrived_gpsfix

For GPSFix: Whether the PVTGeodetic block of the current epoch has arrived or not.

Definition at line 706 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_pvtgeodetic_has_arrived_navsatfix

bool g_pvtgeodetic_has_arrived_navsatfix

For NavSatFix: Whether the PVTGeodetic block of the current epoch has arrived or not.

Definition at line 716 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_pvtgeodetic_has_arrived_pose

bool g_pvtgeodetic_has_arrived_pose

For PoseWithCovarianceStamped: Whether the PVTGeodetic block of the current epoch has arrived or not.

Definition at line 720 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_qualityind_has_arrived_diagnostics

bool g_qualityind_has_arrived_diagnostics

For DiagnosticArray: Whether the QualityInd block of the current epoch has arrived or not.

Definition at line 730 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_read_cd

bool g_read_cd

Whether or not we still want to read the connection descriptor, which we only want in the very beginning to know whether it is IP10, IP11 etc.

Definition at line 694 of file rosaic_node.cpp.

Referenced by io_comm_rx::RxMessage::found(), main(), io_comm_rx::RxMessage::next(), and io_comm_rx::RxMessage::search().

◆ g_receiverstatus_has_arrived_diagnostics

bool g_receiverstatus_has_arrived_diagnostics

For DiagnosticArray: Whether the ReceiverStatus block of the current epoch has arrived or not.

Definition at line 728 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_response_condition

boost::condition_variable g_response_condition

Condition variable complementing "g_response_mutex".

Definition at line 685 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_response_mutex

boost::mutex g_response_mutex

Mutex to control changes of global variable "g_response_received".

Definition at line 681 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_response_received

bool g_response_received

Determines whether a command reply was received from the Rx.

Definition at line 683 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), main(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_ROS_QUEUE_SIZE

const uint32_t g_ROS_QUEUE_SIZE = 1

Queue size for ROS publishers.

Definition at line 745 of file rosaic_node.cpp.

Referenced by io_comm_rx::RxMessage::read().

◆ g_rx_tcp_port

std::string g_rx_tcp_port

Rx TCP port, e.g. IP10 or IP11, to which ROSaic is connected to.

Definition at line 696 of file rosaic_node.cpp.

Referenced by rosaic_node::ROSaicNode::configureRx(), and io_comm_rx::CallbackHandlers::readCallback().

◆ g_use_gnss_time

bool g_use_gnss_time

If true, the ROS message headers' unix time field is constructed from the TOW (in the SBF case) and UTC (in the NMEA case) data. If false, times are constructed within the driver via time(NULL) of the <ctime> library.

Definition at line 665 of file rosaic_node.cpp.

Referenced by main(), GprmcParser::parseASCII(), GpggaParser::parseASCII(), and io_comm_rx::RxMessage::read().

◆ g_velcovgeodetic_has_arrived_gpsfix

bool g_velcovgeodetic_has_arrived_gpsfix

For GPSFix: Whether the VelCovGeodetic block of the current epoch has arrived or not.

Definition at line 710 of file rosaic_node.cpp.

Referenced by main(), io_comm_rx::RxMessage::read(), and io_comm_rx::CallbackHandlers::readCallback().