Functions | Variables
main.cpp File Reference

Main entry point for UM6 driver. Handles serial connection details, as well as all ROS message stuffing, parameters, topics, etc. More...

#include <string>
#include "geometry_msgs/Vector3Stamped.h"
#include "ros/ros.h"
#include "sensor_msgs/Imu.h"
#include "sensor_msgs/MagneticField.h"
#include "serial/serial.h"
#include "std_msgs/Float32.h"
#include "std_msgs/Header.h"
#include "um6/comms.h"
#include "um6/registers.h"
#include "um6/Reset.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

void configureSensor (um6::Comms *sensor, ros::NodeHandle *private_nh)
 
template<typename RegT >
void configureVector3 (um6::Comms *sensor, const um6::Accessor< RegT > &reg, std::string param, std::string human_name)
 
bool handleResetService (um6::Comms *sensor, const um6::Reset::Request &req, const um6::Reset::Response &resp)
 
int main (int argc, char **argv)
 
void publishMsgs (um6::Registers &r, ros::NodeHandle *imu_nh, sensor_msgs::Imu &imu_msg, bool tf_ned_to_enu, bool use_magnetic_field_msg)
 
template<typename RegT >
void sendCommand (um6::Comms *sensor, const um6::Accessor< RegT > &reg, std::string human_name)
 

Variables

const uint8_t TRIGGER_PACKET = UM6_TEMPERATURE
 

Detailed Description

Main entry point for UM6 driver. Handles serial connection details, as well as all ROS message stuffing, parameters, topics, etc.

Author
Mike Purvis mpurv.nosp@m.is@c.nosp@m.learp.nosp@m.athr.nosp@m.oboti.nosp@m.cs.c.nosp@m.om

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Please send comments, questions, or patches to code@.nosp@m.clea.nosp@m.rpath.nosp@m.robo.nosp@m.tics..nosp@m.com

Definition in file main.cpp.

Function Documentation

void configureSensor ( um6::Comms sensor,
ros::NodeHandle private_nh 
)

Send configuration messages to the UM6, critically, to turn on the value outputs which we require, and inject necessary configuration parameters.

Definition at line 102 of file main.cpp.

template<typename RegT >
void configureVector3 ( um6::Comms sensor,
const um6::Accessor< RegT > &  reg,
std::string  param,
std::string  human_name 
)

Function generalizes the process of writing an XYZ vector into consecutive fields in UM6 registers.

Definition at line 57 of file main.cpp.

bool handleResetService ( um6::Comms sensor,
const um6::Reset::Request &  req,
const um6::Reset::Response &  resp 
)

Definition at line 172 of file main.cpp.

int main ( int  argc,
char **  argv 
)

Node entry-point. Handles ROS setup, and serial port connection/reconnection.

Definition at line 328 of file main.cpp.

void publishMsgs ( um6::Registers r,
ros::NodeHandle imu_nh,
sensor_msgs::Imu &  imu_msg,
bool  tf_ned_to_enu,
bool  use_magnetic_field_msg 
)

Uses the register accessors to grab data from the IMU, and populate the ROS messages which are output.

Definition at line 187 of file main.cpp.

template<typename RegT >
void sendCommand ( um6::Comms sensor,
const um6::Accessor< RegT > &  reg,
std::string  human_name 
)

Function generalizes the process of commanding the UM6 via one of its command registers.

Definition at line 88 of file main.cpp.

Variable Documentation

const uint8_t TRIGGER_PACKET = UM6_TEMPERATURE

Definition at line 50 of file main.cpp.



um6
Author(s): Mike Purvis
autogenerated on Thu Sep 26 2019 03:18:02