Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
Mock IMU driver. Operates as a passthrough for bag data which updates the timestamps on received messages */. More...
#include <MockIMUDriver.h>
Public Member Functions | |
MockIMUDriver (bool dummy=false) | |
~MockIMUDriver () | |
std::vector< DriverType > | getDriverTypes () override |
Pure Virtual method which child classes must override that returns the list of all driver types that class implements. More... | |
uint8_t | getDriverStatus () override |
Pure Virtual method. Returns an integer value which corresponds to the cav_msgs/DriverStatus enum felids representing the status of the driver. More... | |
unsigned int | getRate () override |
Pure virtual method that returns the desired operational rate of a child class. More... | |
Public Member Functions inherited from mock_drivers::MockDriver | |
virtual | ~MockDriver ()=0 |
int | run () |
A function to initialize the publishers and subsricers and start the node. In child classes, this function will trigger a call to onRun(). More... | |
virtual std::vector< DriverType > | getDriverTypes ()=0 |
Pure Virtual method which child classes must override that returns the list of all driver types that class implements. More... | |
virtual uint8_t | getDriverStatus ()=0 |
Pure Virtual method. Returns an integer value which corresponds to the cav_msgs/DriverStatus enum felids representing the status of the driver. More... | |
virtual unsigned int | getRate ()=0 |
Pure virtual method that returns the desired operational rate of a child class. More... | |
bool | spinCallback () |
Callback which will be triggered at the rate specified by getRate(). This callback will also trigger the onSpin() method. More... | |
Protected Member Functions | |
int | onRun () override |
Pure virtual method which must be implemented by child classes. This method will be run once at startup. Child classes should add pub/sub initialization in this method implementation. More... | |
Protected Member Functions inherited from mock_drivers::MockDriver | |
virtual bool | onSpin () |
Virtual method which child classes can override to add functionality which will occur during each spin loop. This means this function will be nominally called at the rate specified by getRate() More... | |
virtual int | onRun ()=0 |
Pure virtual method which must be implemented by child classes. This method will be run once at startup. Child classes should add pub/sub initialization in this method implementation. More... | |
void | driverDiscovery () |
Helper function to publish the driver discovery message. More... | |
MockDriverNode | getMockDriverNode () const |
Returns the mock driver node for the mock driver (used for testing) More... | |
template<typename T > | |
void | addPassthroughPub (const std::string &sub_topic, const std::string &pub_topic, bool latch, size_t queue_size) |
Function adds both a publisher and subscriber of the specified type. This means a passthrough subscription has been created. This version of the method should be used for message types which contain a Header at the field "header". The header field will be automatically updated to the current ros::Time::now(). More... | |
template<typename T > | |
void | addPassthroughPubNoHeader (const std::string &sub_topic, const std::string &pub_topic, bool latch, size_t queue_size) |
Function adds both a publisher and subscriber of the specified type. This means a passthrough subscription has been created. This version of the method should be used for message types which does NOT contain a Header at the field "header". More... | |
Private Attributes | |
const std::string | raw_data_topic_ = "imu" |
Additional Inherited Members | |
Protected Types inherited from mock_drivers::MockDriver | |
template<class T > | |
using | ConstPtr = boost::shared_ptr< const T > |
template<class T > | |
using | ConstPtrRef = const ConstPtr< T > & |
template<class T > | |
using | ROSCommsPtr = boost::shared_ptr< ROSComms< T > > |
template<class T > | |
using | ConstPtrRefROSComms = ROSComms< ConstPtrRef< T > > |
template<class T > | |
using | ConstPtrRefROSCommsPtr = ROSCommsPtr< ConstPtrRef< T > > |
Protected Attributes inherited from mock_drivers::MockDriver | |
MockDriverNode | mock_driver_node_ |
const std::string | bag_prefix_ = "/bag/hardware_interface/" |
const std::string | driver_discovery_topic_ = "driver_discovery" |
ROSCommsPtr< cav_msgs::DriverStatus > | driver_discovery_pub_ptr_ |
ros::Time | last_discovery_pub_ = ros::Time(0) |
Mock IMU driver. Operates as a passthrough for bag data which updates the timestamps on received messages */.
Definition at line 25 of file MockIMUDriver.h.
mock_drivers::MockIMUDriver::MockIMUDriver | ( | bool | dummy = false | ) |
Definition at line 31 of file MockIMUDriver.cpp.
References mock_drivers::MockDriver::mock_driver_node_.
|
inline |
Definition at line 35 of file MockIMUDriver.h.
|
overridevirtual |
Pure Virtual method. Returns an integer value which corresponds to the cav_msgs/DriverStatus enum felids representing the status of the driver.
Implements mock_drivers::MockDriver.
Definition at line 26 of file MockIMUDriver.cpp.
|
overridevirtual |
Pure Virtual method which child classes must override that returns the list of all driver types that class implements.
Implements mock_drivers::MockDriver.
Definition at line 21 of file MockIMUDriver.cpp.
References IMU.
|
overridevirtual |
Pure virtual method that returns the desired operational rate of a child class.
Implements mock_drivers::MockDriver.
Definition at line 36 of file MockIMUDriver.cpp.
|
overrideprotectedvirtual |
Pure virtual method which must be implemented by child classes. This method will be run once at startup. Child classes should add pub/sub initialization in this method implementation.
Implements mock_drivers::MockDriver.
Definition at line 41 of file MockIMUDriver.cpp.
References mock_drivers::MockDriver::bag_prefix_, and raw_data_topic_.
|
private |
Definition at line 28 of file MockIMUDriver.h.
Referenced by onRun().