59 #ifndef ROSAIC_NODE_HPP 60 #define ROSAIC_NODE_HPP 71 #include <boost/regex.hpp> 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;
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());
332 #endif // for ROSAIC_NODE_HPP std::string mountpoint_
Mountpoint for NTRIP service.
std::string mode_
Type of NTRIP connection.
std::string hw_flow_control_
HW flow control.
This class represents the ROsaic node, to be extended..
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
std::string ant_type_
Antenna type, from the list returned by the command "lstAntennaInfo, Overview".
uint32_t polling_period_pvt_
Polling period for PVT-related SBF blocks.
void defineMessages()
Defines which Rx messages to read and which ROS messages to publish.
bool publish_attcoveuler_
Whether or not to publish the rosaic::AttCovEuler message.
bool g_publish_navsatfix
Whether or not to publish the sensor_msgs::NavSatFix message.
ros::Timer reconnect_timer_
Our ROS timer governing the reconnection.
bool g_publish_poscovgeodetic
float reconnect_delay_s_
Delay in seconds between reconnection attempts to the connection type specified in the parameter conn...
std::string username_
Username for NTRIP service.
Highest-Level view on communication services.
void reconnect(const ros::TimerEvent &event)
Attempts to (re)connect every reconnect_delay_s_ seconds.
uint32_t caster_port_
IP port number of NTRIP caster to connect to.
bool serial_
Whether yet-to-be-established connection to Rx will be serial or TCP.
ros::Timer g_reconnect_timer_
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...
void getROSParams()
Gets the node parameters from the ROS Parameter Server, parts of which are specified in a YAML file...
bool g_publish_pvtgeodetic
bool connected_
Whether connecting to Rx was successful.
boost::mutex connection_mutex_
std::string tcp_port_
TCP port number.
std::string rx_serial_port_
In case of serial communication to Rx, rx_serial_port_ specifies Rx's serial port connected to...
bool publish_gpgsa_
Whether or not to publish the GSA message.
float delta_u_
Marker-to-ARP offset in the upward direction.
bool publish_poscovgeodetic_
Whether or not to publish the rosaic::PosCovGeodetic message.
void initializeIO()
Initializes the I/O handling.
std::string ant_serial_nr_
Serial number of your particular antenna.
std::string tcp_host_
Host name of TCP server.
void configureRx()
Configures Rx: Which SBF/NMEA messages it should output and later correction settings.
boost::shared_ptr< ros::NodeHandle > g_nh
bool g_publish_pvtcartesian
bool publish_gprmc_
Whether or not to publish the RMC message.
boost::condition_variable connection_condition_
bool publish_pvtcartesian_
Whether or not to publish the rosaic::PVTCartesian message.
const uint32_t g_ROS_QUEUE_SIZE
Queue size for ROS publishers.
bool publish_gpgsv_
Whether or not to publish the GSV message.
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 getROSInt(const std::string &key, U &u)
Gets an integer or unsigned integer value from the parameter server.
std::string rtcm_version_
RTCM version for NTRIP service (if Rx does not have internet)
std::string ntrip_version_
NTRIP version for NTRIP service.
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 publish_gpgga_
Whether or not to publish the GGA message.
bool rx_has_internet_
Whether Rx has internet or not.
bool g_publish_attcoveuler
bool publish_pvtgeodetic_
Whether or not to publish the rosaic::PVTGeodetic message.
std::string device_
Device port.
std::string caster_
Hostname or IP address of the NTRIP caster to connect to.
bool publish_atteuler_
Whether or not to publish the rosaic::AttEuler message.
std::string send_gga_
Whether (and at which rate) or not to send GGA to the NTRIP caster.
float delta_n_
Marker-to-ARP offset in the northward direction.
std::string datum_
Datum to be used.
uint32_t polling_period_rest_
Polling period for all other SBF blocks and NMEA messages.
bool g_publish_gpst
Whether or not to publish the sensor_msgs::TimeReference message with GPST.
void connect()
Calles the reconnect() method.
std::string password_
Password for NTRIP service.
bool publish_poscovcartesian_
Whether or not to publish the rosaic::PosCovCartesian message.
Handles communication with and configuration of the mosaic (and beyond) receiver(s) ...
float delta_e_
Marker-to-ARP offset in the eastward direction.
io_comm_rx::Comm_IO IO
Handles communication with the Rx.
uint32_t baudrate_
Baudrate.