Public Member Functions | Private Member Functions | Private Attributes | List of all members
ros_control_boilerplate::ControllerToCSV Class Reference

#include <controller_to_csv.h>

Public Member Functions

 ControllerToCSV (const std::string &topic)
 Constructor. More...
 
bool recordAll ()
 Whether to record at a specific frequency, or record all incoming data. More...
 
void startRecording (const std::string &file_name)
 Start the data collection. More...
 
void stopRecording ()
 End recording. More...
 
 ~ControllerToCSV ()
 Destructor. More...
 

Private Member Functions

void stateCB (const control_msgs::JointTrajectoryControllerState::ConstPtr &state)
 Callback from ROS message. More...
 
void update (const ros::TimerEvent &e)
 Recieve data from controller via ROS message. More...
 
bool waitForSubscriber (const ros::Subscriber &sub, const double &wait_time=10.0)
 Check if topic has been connected to successfully. More...
 
bool writeToFile ()
 Send all resulting data to file. More...
 

Private Attributes

control_msgs::JointTrajectoryControllerState current_state_
 
std::string file_name_
 
bool first_update_
 
std::string name_ = "controller_to_csv"
 
ros::NodeHandle nh_
 
ros::Timer non_realtime_loop_
 
double record_hz_
 
bool recording_started_
 
ros::Subscriber state_sub_
 
std::vector< control_msgs::JointTrajectoryControllerState > states_
 
std::vector< ros::Timetimestamps_
 

Detailed Description

Definition at line 51 of file controller_to_csv.h.

Constructor & Destructor Documentation

ros_control_boilerplate::ControllerToCSV::ControllerToCSV ( const std::string &  topic)

Constructor.

Parameters
topic- ROS message to listen to from controller

Definition at line 51 of file controller_to_csv.cpp.

ros_control_boilerplate::ControllerToCSV::~ControllerToCSV ( )

Destructor.

Definition at line 83 of file controller_to_csv.cpp.

Member Function Documentation

bool ros_control_boilerplate::ControllerToCSV::recordAll ( )

Whether to record at a specific frequency, or record all incoming data.

Definition at line 88 of file controller_to_csv.cpp.

void ros_control_boilerplate::ControllerToCSV::startRecording ( const std::string &  file_name)

Start the data collection.

Definition at line 111 of file controller_to_csv.cpp.

void ros_control_boilerplate::ControllerToCSV::stateCB ( const control_msgs::JointTrajectoryControllerState::ConstPtr &  state)
private

Callback from ROS message.

Definition at line 93 of file controller_to_csv.cpp.

void ros_control_boilerplate::ControllerToCSV::stopRecording ( )

End recording.

Definition at line 154 of file controller_to_csv.cpp.

void ros_control_boilerplate::ControllerToCSV::update ( const ros::TimerEvent e)
private

Recieve data from controller via ROS message.

Definition at line 130 of file controller_to_csv.cpp.

bool ros_control_boilerplate::ControllerToCSV::waitForSubscriber ( const ros::Subscriber sub,
const double &  wait_time = 10.0 
)
private

Check if topic has been connected to successfully.

Definition at line 216 of file controller_to_csv.cpp.

bool ros_control_boilerplate::ControllerToCSV::writeToFile ( )
private

Send all resulting data to file.

Definition at line 160 of file controller_to_csv.cpp.

Member Data Documentation

control_msgs::JointTrajectoryControllerState ros_control_boilerplate::ControllerToCSV::current_state_
private

Definition at line 108 of file controller_to_csv.h.

std::string ros_control_boilerplate::ControllerToCSV::file_name_
private

Definition at line 101 of file controller_to_csv.h.

bool ros_control_boilerplate::ControllerToCSV::first_update_
private

Definition at line 93 of file controller_to_csv.h.

std::string ros_control_boilerplate::ControllerToCSV::name_ = "controller_to_csv"
private

Definition at line 87 of file controller_to_csv.h.

ros::NodeHandle ros_control_boilerplate::ControllerToCSV::nh_
private

Definition at line 90 of file controller_to_csv.h.

ros::Timer ros_control_boilerplate::ControllerToCSV::non_realtime_loop_
private

Definition at line 111 of file controller_to_csv.h.

double ros_control_boilerplate::ControllerToCSV::record_hz_
private

Definition at line 98 of file controller_to_csv.h.

bool ros_control_boilerplate::ControllerToCSV::recording_started_
private

Definition at line 94 of file controller_to_csv.h.

ros::Subscriber ros_control_boilerplate::ControllerToCSV::state_sub_
private

Definition at line 97 of file controller_to_csv.h.

std::vector<control_msgs::JointTrajectoryControllerState> ros_control_boilerplate::ControllerToCSV::states_
private

Definition at line 104 of file controller_to_csv.h.

std::vector<ros::Time> ros_control_boilerplate::ControllerToCSV::timestamps_
private

Definition at line 105 of file controller_to_csv.h.


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


ros_control_boilerplate
Author(s): Dave Coleman
autogenerated on Thu Feb 25 2021 03:58:54