Tetrapod Project
LogUtils Class Reference

A class for logging utilities. More...

#include <log_utils.h>

Collaboration diagram for LogUtils:

Public Member Functions

 LogUtils ()
 Constructor. More...
 
virtual ~LogUtils ()
 Destructor. More...
 
void WriteToLog ()
 
void OnGenCoordMsg (const std_msgs::Float64MultiArrayConstPtr &_msg)
 The OnGenCoordMsg function handles an incoming generalized coordinates message from ROS. More...
 
void OnGenVelMsg (const std_msgs::Float64MultiArrayConstPtr &_msg)
 The OnGenVelMsg function handles an incoming generalized velocities message from ROS. More...
 
void OnJointStateMsg (const sensor_msgs::JointStateConstPtr &_msg)
 The OnJointStateMsg function handles an incoming joint state message from ROS. More...
 
void OnJointStateCmdMsg (const sensor_msgs::JointStateConstPtr &_msg)
 The OnJointStateCmdMsg function handles an incoming joint state command message from ROS. More...
 
void PublishQueueThread ()
 The PublishQueueThread function is a ROS helper function that publish state messages. More...
 
void ProcessQueueThread ()
 The ProcessQueueThread function is a ROS helper function that processes messages. More...
 

Protected Member Functions

void InitRos ()
 The InitRos function is called to initialize ROS. More...
 
void InitRosQueueThreads ()
 The InitRosQueueThreads function is called to initialize the ROS Publish and Process Queue Threads. More...
 

Private Attributes

Kinematics kinematics
 Kinematics. More...
 
Eigen::Matrix< double, 18, 1 > genCoord
 Generalized Coordinates. More...
 
Eigen::Matrix< double, 18, 1 > genVel
 Generalized Velocities. More...
 
sensor_msgs::JointState jointState
 Joint State. More...
 
sensor_msgs::JointState jointStateCmd
 Joint State Command. More...
 
Eigen::Matrix< Eigen::Vector3d, 4, 1 > fPos
 Footstep positions. More...
 
int contactState [4]
 Contact State. More...
 
std::unique_ptr< ros::NodeHandle > rosNode
 Node used for ROS transport. More...
 
ros::Subscriber genCoordSub
 ROS Generalized Coordinates Subscriber. More...
 
ros::Subscriber genVelSub
 ROS Generalized Coordinates Subscriber. More...
 
ros::Subscriber jointStateSub
 ROS Joint State Subscriber. More...
 
ros::Subscriber jointStateCmdSub
 ROS Joint State Command Subscriber. More...
 
ros::Subscriber contactStateSub
 ROS Contact State Subscriber. More...
 
ros::Publisher genCoordLogPub
 ROS Generalized Coordinates Log Publisher. More...
 
ros::Publisher genVelLogPub
 ROS Generalized Velocities Log Publisher. More...
 
ros::Publisher jointStatePub
 ROS Joint State Log Publisher. More...
 
ros::Publisher jointStateCmdPub
 ROS Joint State Command Log Publisher. More...
 
ros::CallbackQueue rosPublishQueue
 ROS callbackque that helps publish messages. More...
 
ros::CallbackQueue rosProcessQueue
 ROS callbackque that helps process messages. More...
 
std::thread rosPublishQueueThread
 Thread running the rosPublishQueue. More...
 
std::thread rosProcessQueueThread
 Thread running the rosProcessQueue. More...
 

Detailed Description

A class for logging utilities.

Definition at line 48 of file log_utils.h.

Constructor & Destructor Documentation

◆ LogUtils()

LogUtils::LogUtils ( )

Constructor.

Definition at line 30 of file log_utils.cpp.

◆ ~LogUtils()

LogUtils::~LogUtils ( )
virtual

Destructor.

Definition at line 43 of file log_utils.cpp.

Member Function Documentation

◆ WriteToLog()

void LogUtils::WriteToLog ( )

Definition at line 57 of file log_utils.cpp.

◆ OnGenCoordMsg()

void LogUtils::OnGenCoordMsg ( const std_msgs::Float64MultiArrayConstPtr &  _msg)

The OnGenCoordMsg function handles an incoming generalized coordinates message from ROS.

Parameters
[in]_msgA float array containing the generalized coordinates.

Definition at line 69 of file log_utils.cpp.

◆ OnGenVelMsg()

void LogUtils::OnGenVelMsg ( const std_msgs::Float64MultiArrayConstPtr &  _msg)

The OnGenVelMsg function handles an incoming generalized velocities message from ROS.

Parameters
[in]_msgA float array containing the generalized velocities.

Definition at line 87 of file log_utils.cpp.

◆ OnJointStateMsg()

void LogUtils::OnJointStateMsg ( const sensor_msgs::JointStateConstPtr &  _msg)

The OnJointStateMsg function handles an incoming joint state message from ROS.

Parameters
[in]_msgA message holding data to describe the state of a set of controlled joints. The state is defined by
  • the position of the joint,
  • the velocity of the joint and
  • the effort (torque) that is applied in the joint.

Definition at line 96 of file log_utils.cpp.

◆ OnJointStateCmdMsg()

void LogUtils::OnJointStateCmdMsg ( const sensor_msgs::JointStateConstPtr &  _msg)

The OnJointStateCmdMsg function handles an incoming joint state command message from ROS.

Parameters
[in]_msgA message holding data to describe the state of a set of controlled joints. The state is defined by
  • the position of the joint,
  • the velocity of the joint and
  • the effort (torque) that is applied in the joint.

Definition at line 105 of file log_utils.cpp.

◆ PublishQueueThread()

void LogUtils::PublishQueueThread ( )

The PublishQueueThread function is a ROS helper function that publish state messages.

Definition at line 114 of file log_utils.cpp.

◆ ProcessQueueThread()

void LogUtils::ProcessQueueThread ( )

The ProcessQueueThread function is a ROS helper function that processes messages.

Definition at line 124 of file log_utils.cpp.

◆ InitRos()

void LogUtils::InitRos ( )
protected

The InitRos function is called to initialize ROS.

Definition at line 134 of file log_utils.cpp.

◆ InitRosQueueThreads()

void LogUtils::InitRosQueueThreads ( )
protected

The InitRosQueueThreads function is called to initialize the ROS Publish and Process Queue Threads.

Definition at line 245 of file log_utils.cpp.

Member Data Documentation

◆ kinematics

Kinematics LogUtils::kinematics
private

Kinematics.

Definition at line 105 of file log_utils.h.

◆ genCoord

Eigen::Matrix<double, 18, 1> LogUtils::genCoord
private

Generalized Coordinates.

Definition at line 108 of file log_utils.h.

◆ genVel

Eigen::Matrix<double, 18, 1> LogUtils::genVel
private

Generalized Velocities.

Definition at line 111 of file log_utils.h.

◆ jointState

sensor_msgs::JointState LogUtils::jointState
private

Joint State.

Definition at line 114 of file log_utils.h.

◆ jointStateCmd

sensor_msgs::JointState LogUtils::jointStateCmd
private

Joint State Command.

Definition at line 117 of file log_utils.h.

◆ fPos

Eigen::Matrix<Eigen::Vector3d, 4, 1> LogUtils::fPos
private

Footstep positions.

Definition at line 120 of file log_utils.h.

◆ contactState

int LogUtils::contactState[4]
private

Contact State.

Definition at line 123 of file log_utils.h.

◆ rosNode

std::unique_ptr<ros::NodeHandle> LogUtils::rosNode
private

Node used for ROS transport.

Definition at line 126 of file log_utils.h.

◆ genCoordSub

ros::Subscriber LogUtils::genCoordSub
private

ROS Generalized Coordinates Subscriber.

Definition at line 129 of file log_utils.h.

◆ genVelSub

ros::Subscriber LogUtils::genVelSub
private

ROS Generalized Coordinates Subscriber.

Definition at line 132 of file log_utils.h.

◆ jointStateSub

ros::Subscriber LogUtils::jointStateSub
private

ROS Joint State Subscriber.

Definition at line 135 of file log_utils.h.

◆ jointStateCmdSub

ros::Subscriber LogUtils::jointStateCmdSub
private

ROS Joint State Command Subscriber.

Definition at line 138 of file log_utils.h.

◆ contactStateSub

ros::Subscriber LogUtils::contactStateSub
private

ROS Contact State Subscriber.

Definition at line 141 of file log_utils.h.

◆ genCoordLogPub

ros::Publisher LogUtils::genCoordLogPub
private

ROS Generalized Coordinates Log Publisher.

Definition at line 144 of file log_utils.h.

◆ genVelLogPub

ros::Publisher LogUtils::genVelLogPub
private

ROS Generalized Velocities Log Publisher.

Definition at line 147 of file log_utils.h.

◆ jointStatePub

ros::Publisher LogUtils::jointStatePub
private

ROS Joint State Log Publisher.

Definition at line 150 of file log_utils.h.

◆ jointStateCmdPub

ros::Publisher LogUtils::jointStateCmdPub
private

ROS Joint State Command Log Publisher.

Definition at line 153 of file log_utils.h.

◆ rosPublishQueue

ros::CallbackQueue LogUtils::rosPublishQueue
private

ROS callbackque that helps publish messages.

Definition at line 156 of file log_utils.h.

◆ rosProcessQueue

ros::CallbackQueue LogUtils::rosProcessQueue
private

ROS callbackque that helps process messages.

Definition at line 159 of file log_utils.h.

◆ rosPublishQueueThread

std::thread LogUtils::rosPublishQueueThread
private

Thread running the rosPublishQueue.

Definition at line 162 of file log_utils.h.

◆ rosProcessQueueThread

std::thread LogUtils::rosProcessQueueThread
private

Thread running the rosProcessQueue.

Definition at line 165 of file log_utils.h.


The documentation for this class was generated from the following files: