Endorob  1.4
A C++ Robotics library by P. Berthet-Rayne
Motion_RW Class Reference

Motion recorder Class. More...

#include <endorob.h>

Public Member Functions

 Motion_RW ()
 
 Motion_RW (Endorob *robot)
 
 ~Motion_RW ()
 
void set_endorob_pointer (Endorob *robot)
 
void set_virt_snake_pointer (Virtual_Snake *virt_snake)
 
void set_write_frequency (const double &freq)
 
void set_read_frequency (const double &freq)
 
void start_recording ()
 
void stop_recording ()
 
void set_file_name_write (const std::string &file)
 
void set_file_name_read (const std::string &file)
 
void load_file (const std::string &file)
 
void load_virtual_snake_file (const std::string &file)
 
void benchmark_virtual_snake_file (const std::string &file)
 
void benchmark_virtual_snake_vec (const std::vector< Vec > &virtual_vec, const std::vector< Mat4d > &Td_vec)
 
void write_once (const Virtual_Snake &curv, const Mat4d &Ttip)
 
void write_once (const char &key)
 
bool is_reading_finished ()
 
bool is_running ()
 

Protected Types

enum  File_type { File_type::Joint, File_type::Virtual_robot, File_type::Master }
 

Protected Member Functions

void motion_RW_loop (int a, int b)
 
void output_header ()
 
void output_data ()
 

Protected Attributes

std::thread * pthread
 
volatile bool m_run
 
bool m_header_written
 
volatile bool m_start_loop
 
double m_period_write
 
double m_period_read
 
Endorobprobot
 
Virtual_Snakepvirt_snake
 
std::ofstream m_file_write
 
std::ifstream m_file_read
 
Time_point m_t0_write
 
Time_point m_t0_read
 
Time_point m_start_time
 
std::string m_file_name_write
 
std::string m_file_name_read
 
Motion_mode m_mode
 
std::vector< Mat, Eigen::aligned_allocator< Mat > > m_q_data
 
std::vector< Mat, Eigen::aligned_allocator< Mat > > m_T_data
 
std::vector< double > m_error_data
 
std::vector< double > m_input_timing
 
std::vector< Vecm_virtual_snake_data
 
std::vector< Mat4dm_tip_data
 
bool m_overwrite_file_period
 
File_type m_file_type
 
bool m_runonce
 
std::ofstream m_benchmark_file
 
std::ofstream m_benchmark_check_file
 
Snake_Path m_robot_path_for_plot
 

Static Protected Attributes

static uint m_file_counter = 0
 

Detailed Description

Motion recorder Class.

This class is only used internally to EndoRob, but you can still use it... It is a threaded motion and data recorder that can save motion data to file at a desired frequency, but also read and replay at a desired frequency.

Definition at line 1101 of file endorob.h.

Member Enumeration Documentation

◆ File_type

enum Motion_RW::File_type
strongprotected
Enumerator
Joint 

Joint vector data.

Virtual_robot 

virtual robot input data

Master 

Master input data.

Definition at line 1162 of file endorob.h.

Constructor & Destructor Documentation

◆ Motion_RW() [1/2]

Motion_RW::Motion_RW ( )

Definition at line 3569 of file endorob.cpp.

◆ Motion_RW() [2/2]

Motion_RW::Motion_RW ( Endorob robot)

Definition at line 3594 of file endorob.cpp.

◆ ~Motion_RW()

Motion_RW::~Motion_RW ( )

Definition at line 3620 of file endorob.cpp.

Member Function Documentation

◆ benchmark_virtual_snake_file()

void Motion_RW::benchmark_virtual_snake_file ( const std::string &  file)

Definition at line 3961 of file endorob.cpp.

◆ benchmark_virtual_snake_vec()

void Motion_RW::benchmark_virtual_snake_vec ( const std::vector< Vec > &  virtual_vec,
const std::vector< Mat4d > &  Td_vec 
)

Definition at line 4055 of file endorob.cpp.

◆ is_reading_finished()

bool Motion_RW::is_reading_finished ( )

Definition at line 4161 of file endorob.cpp.

◆ is_running()

bool Motion_RW::is_running ( )

Definition at line 4181 of file endorob.cpp.

◆ load_file()

void Motion_RW::load_file ( const std::string &  file)

Definition at line 3719 of file endorob.cpp.

◆ load_virtual_snake_file()

void Motion_RW::load_virtual_snake_file ( const std::string &  file)

Definition at line 3867 of file endorob.cpp.

◆ motion_RW_loop()

void Motion_RW::motion_RW_loop ( int  a,
int  b 
)
protected

Definition at line 4188 of file endorob.cpp.

◆ output_data()

void Motion_RW::output_data ( )
protected

Definition at line 4591 of file endorob.cpp.

◆ output_header()

void Motion_RW::output_header ( )
protected

Definition at line 4568 of file endorob.cpp.

◆ set_endorob_pointer()

void Motion_RW::set_endorob_pointer ( Endorob robot)

Definition at line 3645 of file endorob.cpp.

◆ set_file_name_read()

void Motion_RW::set_file_name_read ( const std::string &  file)

Definition at line 3714 of file endorob.cpp.

◆ set_file_name_write()

void Motion_RW::set_file_name_write ( const std::string &  file)

Definition at line 3709 of file endorob.cpp.

◆ set_read_frequency()

void Motion_RW::set_read_frequency ( const double &  freq)

Definition at line 3660 of file endorob.cpp.

◆ set_virt_snake_pointer()

void Motion_RW::set_virt_snake_pointer ( Virtual_Snake virt_snake)

Definition at line 3650 of file endorob.cpp.

◆ set_write_frequency()

void Motion_RW::set_write_frequency ( const double &  freq)

Definition at line 3655 of file endorob.cpp.

◆ start_recording()

void Motion_RW::start_recording ( )

Definition at line 3666 of file endorob.cpp.

◆ stop_recording()

void Motion_RW::stop_recording ( )

Definition at line 3699 of file endorob.cpp.

◆ write_once() [1/2]

void Motion_RW::write_once ( const char &  key)

Definition at line 4137 of file endorob.cpp.

◆ write_once() [2/2]

void Motion_RW::write_once ( const Virtual_Snake curv,
const Mat4d Ttip 
)

Definition at line 4073 of file endorob.cpp.

Member Data Documentation

◆ m_benchmark_check_file

std::ofstream Motion_RW::m_benchmark_check_file
protected

Definition at line 1171 of file endorob.h.

◆ m_benchmark_file

std::ofstream Motion_RW::m_benchmark_file
protected

Definition at line 1170 of file endorob.h.

◆ m_error_data

std::vector<double> Motion_RW::m_error_data
protected

Definition at line 1156 of file endorob.h.

◆ m_file_counter

uint Motion_RW::m_file_counter = 0
staticprotected

Definition at line 1168 of file endorob.h.

◆ m_file_name_read

std::string Motion_RW::m_file_name_read
protected

Definition at line 1152 of file endorob.h.

◆ m_file_name_write

std::string Motion_RW::m_file_name_write
protected

Definition at line 1152 of file endorob.h.

◆ m_file_read

std::ifstream Motion_RW::m_file_read
protected

Definition at line 1150 of file endorob.h.

◆ m_file_type

File_type Motion_RW::m_file_type
protected

Definition at line 1167 of file endorob.h.

◆ m_file_write

std::ofstream Motion_RW::m_file_write
protected

Definition at line 1149 of file endorob.h.

◆ m_header_written

bool Motion_RW::m_header_written
protected

Definition at line 1144 of file endorob.h.

◆ m_input_timing

std::vector<double> Motion_RW::m_input_timing
protected

Definition at line 1158 of file endorob.h.

◆ m_mode

Motion_mode Motion_RW::m_mode
protected

Definition at line 1153 of file endorob.h.

◆ m_overwrite_file_period

bool Motion_RW::m_overwrite_file_period
protected

Definition at line 1161 of file endorob.h.

◆ m_period_read

double Motion_RW::m_period_read
protected

Definition at line 1146 of file endorob.h.

◆ m_period_write

double Motion_RW::m_period_write
protected

Definition at line 1146 of file endorob.h.

◆ m_q_data

std::vector<Mat, Eigen::aligned_allocator<Mat> > Motion_RW::m_q_data
protected

Definition at line 1154 of file endorob.h.

◆ m_robot_path_for_plot

Snake_Path Motion_RW::m_robot_path_for_plot
protected

Definition at line 1174 of file endorob.h.

◆ m_run

volatile bool Motion_RW::m_run
protected

Definition at line 1143 of file endorob.h.

◆ m_runonce

bool Motion_RW::m_runonce
protected

Definition at line 1169 of file endorob.h.

◆ m_start_loop

volatile bool Motion_RW::m_start_loop
protected

Definition at line 1145 of file endorob.h.

◆ m_start_time

Time_point Motion_RW::m_start_time
protected

Definition at line 1151 of file endorob.h.

◆ m_t0_read

Time_point Motion_RW::m_t0_read
protected

Definition at line 1151 of file endorob.h.

◆ m_t0_write

Time_point Motion_RW::m_t0_write
protected

Definition at line 1151 of file endorob.h.

◆ m_T_data

std::vector<Mat, Eigen::aligned_allocator<Mat> > Motion_RW::m_T_data
protected

Definition at line 1155 of file endorob.h.

◆ m_tip_data

std::vector<Mat4d> Motion_RW::m_tip_data
protected

Definition at line 1160 of file endorob.h.

◆ m_virtual_snake_data

std::vector<Vec> Motion_RW::m_virtual_snake_data
protected

Definition at line 1159 of file endorob.h.

◆ probot

Endorob* Motion_RW::probot
protected

Definition at line 1147 of file endorob.h.

◆ pthread

std::thread* Motion_RW::pthread
protected

Definition at line 1142 of file endorob.h.

◆ pvirt_snake

Virtual_Snake* Motion_RW::pvirt_snake
protected

Definition at line 1148 of file endorob.h.


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