Namespaces | Typedefs | Enumerations | 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 "sensor_msgs/MagneticField.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.

Namespaces

 OutputAxisOptions
 

Typedefs

typedef OutputAxisOptions::OutputAxisOption OutputAxisOption
 

Enumerations

enum  OutputAxisOptions::OutputAxisOption { OutputAxisOptions::DEFAULT, OutputAxisOptions::ENU, OutputAxisOptions::ROBOT_FRAME }
 

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, OutputAxisOption axes, bool use_magnetic_field_msg)
 
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 mpurv.nosp@m.is@c.nosp@m.learp.nosp@m.athr.nosp@m.oboti.nosp@m.cs.c.nosp@m.om (original code for UM6)
Author
Alex Brown rbira.nosp@m.c@co.nosp@m.x.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:

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.

Typedef Documentation

Definition at line 61 of 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 113 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 68 of file main.cpp.

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

Definition at line 203 of file main.cpp.

int main ( int  argc,
char **  argv 
)

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

Definition at line 424 of file main.cpp.

void publishMsgs ( um7::Registers r,
ros::NodeHandle imu_nh,
sensor_msgs::Imu &  imu_msg,
OutputAxisOption  axes,
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 217 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 99 of file main.cpp.

Variable Documentation

const uint8_t TRIGGER_PACKET = DREG_EULER_PHI_THETA

Definition at line 52 of file main.cpp.

const char VERSION[10] = "0.0.2"

Definition at line 48 of file main.cpp.



um7
Author(s): Mike Purvis , Alex Brown
autogenerated on Tue Feb 11 2020 03:26:50