59 #ifndef ROSAIC_NODE_HPP 60 #define ROSAIC_NODE_HPP 69 #include <ros/console.h> 71 #include <boost/regex.hpp> 85 extern boost::shared_ptr<ros::NodeHandle>
g_nh;
106 template <
typename V,
typename T>
109 if(val < min || val > max)
111 std::stringstream ss;
112 ss <<
"Invalid settings: " << name <<
" must be in range [" << min <<
", " << max <<
"].";
113 throw std::runtime_error(ss.str());
124 template <
typename V,
typename T>
125 void checkRange(std::vector<V> val, T min, T max, std::string name)
127 for(
size_t i = 0; i < val.size(); i++)
129 std::stringstream ss;
130 ss << name <<
"[" << i <<
"]";
142 template <
typename U>
145 if (!
g_nh->getParam(key, param))
return false;
146 U min = std::numeric_limits<U>::lowest();
147 U max = std::numeric_limits<U>::max();
152 catch (std::runtime_error& e)
154 std::ostringstream ss;
156 ROS_INFO(
"%s", ss.str().c_str());
170 template <
typename U>
171 void getROSInt(
const std::string& key, U &u, U default_val)
184 template <
typename U>
185 bool getROSInt(
const std::string& key, std::vector<U> &u)
187 std::vector<int> param;
188 if (!
g_nh->getParam(key, param))
return false;
189 U min = std::numeric_limits<U>::lowest();
190 U max = std::numeric_limits<U>::max();
192 u.insert(u.begin(), param.begin(), param.end());
233 void reconnect(
const ros::TimerEvent& event);
332 #endif // for ROSAIC_NODE_HPP std::string rtcm_version_
RTCM version for NTRIP service (if Rx does not have internet)
uint32_t polling_period_pvt_
Polling period for PVT-related SBF blocks.
std::string password_
Password for NTRIP service.
bool publish_attcoveuler_
Whether or not to publish the rosaic::AttCovEuler message.
boost::mutex connection_mutex_
bool publish_gprmc_
Whether or not to publish the RMC message.
bool serial_
Whether yet-to-be-established connection to Rx will be serial or TCP.
uint32_t polling_period_rest_
Polling period for all other SBF blocks and NMEA messages.
bool rx_has_internet_
Whether Rx has internet or not.
bool publish_pvtcartesian_
Whether or not to publish the rosaic::PVTCartesian message.
bool g_publish_navsatfix
Whether or not to publish the sensor_msgs::NavSatFix message.
bool g_publish_poscovgeodetic
bool publish_poscovcartesian_
Whether or not to publish the rosaic::PosCovCartesian message.
Highest-Level view on communication services.
std::string ant_type_
Antenna type, from the list returned by the command "lstAntennaInfo, Overview".
ros::Timer g_reconnect_timer_
std::string rx_serial_port_
In case of serial communication to Rx, rx_serial_port_ specifies Rx's serial port connected to...
void connect()
Calles the reconnect() method.
void getROSParams()
Gets the node parameters from the ROS Parameter Server, parts of which are specified in a YAML file...
bool g_publish_pvtgeodetic
uint32_t rx_input_corrections_tcp_
Rx TCP port number, e.g. 28785, on which Rx receives the corrections (can't be the same as main conne...
bool publish_poscovgeodetic_
Whether or not to publish the rosaic::PosCovGeodetic message.
bool publish_atteuler_
Whether or not to publish the rosaic::AttEuler message.
float delta_n_
Marker-to-ARP offset in the northward direction.
bool publish_pvtgeodetic_
Whether or not to publish the rosaic::PVTGeodetic message.
void defineMessages()
Defines which Rx messages to read and which ROS messages to publish.
void initializeIO()
Initializes the I/O handling.
bool publish_gpgsv_
Whether or not to publish the GSV message.
uint32_t caster_port_
IP port number of NTRIP caster to connect to.
std::string tcp_port_
TCP port number.
boost::condition_variable connection_condition_
Handles communication with and configuration of the mosaic (and beyond) receiver(s) ...
std::string ant_serial_nr_
Serial number of your particular antenna.
boost::shared_ptr< ros::NodeHandle > g_nh
void reconnect(const ros::TimerEvent &event)
Attempts to (re)connect every reconnect_delay_s_ seconds.
bool g_publish_pvtcartesian
uint32_t baudrate_
Baudrate.
std::string username_
Username for NTRIP service.
std::string mountpoint_
Mountpoint for NTRIP service.
const uint32_t g_ROS_QUEUE_SIZE
Queue size for ROS publishers.
bool publish_gpgga_
Whether or not to publish the GGA message.
bool getROSInt(const std::string &key, U &u)
Gets an integer or unsigned integer value from the parameter server.
float reconnect_delay_s_
Delay in seconds between reconnection attempts to the connection type specified in the parameter conn...
std::string tcp_host_
Host name of TCP server.
std::string mode_
Type of NTRIP connection.
std::string send_gga_
Whether (and at which rate) or not to send GGA to the NTRIP caster.
bool connected_
Whether connecting to Rx was successful.
void checkRange(V val, T min, T max, std::string name)
Checks whether the parameter is in the given range.
bool g_publish_poscovcartesian
bool g_publish_attcoveuler
void configureRx()
Configures Rx: Which SBF/NMEA messages it should output and later correction settings.
float delta_e_
Marker-to-ARP offset in the eastward direction.
std::string device_
Device port.
std::string rx_input_corrections_serial_
Rx serial port, e.g. USB2, on which Rx receives the corrections (can't be the same as main connection...
bool publish_gpgsa_
Whether or not to publish the GSA message.
std::string datum_
Datum to be used.
std::string caster_
Hostname or IP address of the NTRIP caster to connect to.
bool g_publish_gpst
Whether or not to publish the sensor_msgs::TimeReference message with GPST.
ros::Timer reconnect_timer_
Our ROS timer governing the reconnection.
std::string ntrip_version_
NTRIP version for NTRIP service.
This class represents the ROsaic node, to be extended..
io_comm_rx::Comm_IO IO
Handles communication with the Rx.
float delta_u_
Marker-to-ARP offset in the upward direction.
std::string hw_flow_control_
HW flow control.