20 #include "sensor_msgs/NavSatFix.h" 27 #define QUEUE_LENGTH 20 29 int main(
int argc,
char* argv[])
40 n.
param(
"SerialPath", path, std::string(
"/dev/ttyUSB0"));
41 n.
param(
"SerialBaud", baud, 9600);
42 n.
param(
"SerialTimeout", timeout_ms, 1000);
52 bool validIMU, validGPS;
53 sensor_msgs::Imu imu_msg;
54 sensor_msgs::NavSatFix gps_msg;
55 INSDrv.
read(imu_msg, gps_msg, validIMU, validGPS);
57 ROS_INFO(
"Publishing valid IMU message");
61 ROS_INFO(
"Publishing valid GPS message");
62 nav_pub.publish(gps_msg);
64 }
catch (
const std::exception& e) {
65 ROS_ERROR(
"Reading from INS driver failed");
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void read(sensor_msgs::Imu &imuMsg, sensor_msgs::NavSatFix &fixMsg, bool &validImu, bool &validFix)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char *argv[])
ROSCPP_DECL void spinOnce()