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 "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)
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 *n, const std_msgs::Header &header)
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 <mpurvis@clearpathrobotics.com>

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Clearpath Robotics, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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@clearpathrobotics.com

Definition in file main.cpp.


Function Documentation

void configureSensor ( um6::Comms sensor)

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

Definition at line 101 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 56 of file main.cpp.

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

Definition at line 160 of file main.cpp.

int main ( int  argc,
char **  argv 
)

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

Definition at line 250 of file main.cpp.

void publishMsgs ( um6::Registers r,
ros::NodeHandle n,
const std_msgs::Header header 
)

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

Definition at line 175 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 87 of file main.cpp.


Variable Documentation

Definition at line 49 of file main.cpp.



um6
Author(s): Mike Purvis
autogenerated on Thu Aug 27 2015 15:31:34