Functions | Variables
main.cpp File Reference

Main entry point for UM7 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 "um7/comms.h"
#include "um7/registers.h"
#include "um7/Reset.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

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

Variables

const uint8_t TRIGGER_PACKET = DREG_EULER_PHI_THETA
const char VERSION [10] = "0.0.2"

Detailed Description

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

Author:
Mike Purvis <mpurvis@clearpathrobotics.com> (original code for UM6)
Author:
Alex Brown <rbirac@cox.net> (adapted to UM7)

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. OR ALEX BROWN 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.

Definition in file main.cpp.


Function Documentation

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

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

Definition at line 103 of file main.cpp.

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

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

Definition at line 58 of file main.cpp.

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

Definition at line 193 of file main.cpp.

int main ( int  argc,
char **  argv 
)

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

Definition at line 313 of file main.cpp.

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

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

Definition at line 207 of file main.cpp.

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

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

Definition at line 89 of file main.cpp.


Variable Documentation

Definition at line 51 of file main.cpp.

const char VERSION[10] = "0.0.2"

Definition at line 47 of file main.cpp.



um7
Author(s): Mike Purvis , Alex Brown
autogenerated on Thu Jun 6 2019 19:34:53