#include <controller_to_csv.h>
Public Member Functions | |
ControllerToCSV (const std::string &topic) | |
Constructor. | |
bool | recordAll () |
Whether to record at a specific frequency, or record all incoming data. | |
void | startRecording (const std::string &file_name) |
Start the data collection. | |
void | stopRecording () |
End recording. | |
~ControllerToCSV () | |
Destructor. | |
Private Member Functions | |
void | stateCB (const control_msgs::JointTrajectoryControllerState::ConstPtr &state) |
Callback from ROS message. | |
void | update (const ros::TimerEvent &e) |
Recieve data from controller via ROS message. | |
bool | waitForSubscriber (const ros::Subscriber &sub, const double &wait_time=10.0) |
Check if topic has been connected to successfully. | |
bool | writeToFile () |
Send all resulting data to file. | |
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::Time > | timestamps_ |
Definition at line 51 of file controller_to_csv.h.
ros_control_boilerplate::ControllerToCSV::ControllerToCSV | ( | const std::string & | topic | ) |
Constructor.
topic | - ROS message to listen to from controller |
Definition at line 51 of file controller_to_csv.cpp.
Destructor.
Definition at line 83 of file controller_to_csv.cpp.
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.
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.
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.
Definition at line 90 of file controller_to_csv.h.
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.
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.