Go to the documentation of this file.
9 #ifndef SOT_TRAJECTORY_H__
10 #define SOT_TRAJECTORY_H__
16 #include <boost/array.hpp>
17 #include <boost/assign/list_of.hpp>
18 #include <boost/regex.hpp>
22 namespace ba = boost::assign;
58 boost::match_results<std::string::const_iterator> &what, boost::regex &e,
59 std::string &sub_text);
65 void parse_header(std::string &text, std::string &sub_text1);
74 bool parse_seq(std::string &text, std::string &sub_text1,
75 std::vector<double> &seq);
78 bool parse_point(std::string &trajectory, std::string &sub_text1);
81 bool parse_points(std::string &trajectory, std::string &sub_text1);
93 timestamp(
unsigned long int lsecs,
unsigned long int lnsecs) {
98 if ((secs_ != other.
secs_) || (nsecs_ != other.
nsecs_))
return false;
117 Header() : seq_(0), stamp_(0, 0), frame_id_(
"initial_trajectory") {}
130 boost::array<std::string, 4> names = boost::assign::list_of(
"Positions")(
131 "Velocities")(
"Accelerations")(
"Effort");
133 const std::vector<double> *
points = 0;
135 for (std::size_t arrayId = 0; arrayId < names.size(); ++arrayId) {
153 std::vector<double>::const_iterator it_db;
154 os << names[arrayId] << std::endl <<
"---------" << std::endl;
155 for (it_db =
points->begin(); it_db !=
points->end(); it_db++) {
156 os << *it_db << std::endl;
161 void transfer(
const std::vector<double> &
src, std::size_t vecId) {
170 accelerations_ =
src;
194 size_type deserialize(std::istringstream &is);
195 void display(std::ostream &)
const;
void parse_header(std::string &text, std::string &sub_text1)
Find and store the header. This method is looking for: std::size_t seq. std::size_t sec,...
std::vector< double > accelerations_
boost::regex bg_liste_of_pts_re
std::string point_value_str_re
std::string end_pt_str_re
std::string joint_name_str_re
bool search_exp_sub_string(std::string &text, boost::match_results< std::string::const_iterator > &what, boost::regex &e, std::string &sub_text)
General parsing method of text with regexp e. The results are given in what. The remaining text is le...
bool operator==(const timestamp &other) const
void display(std::ostream &os) const
RulesJointTrajectory(Trajectory &TrajectoryToFill)
Constructor TrajectoryToFill is the structure where to store the parsed information.
boost::regex list_of_pv_re
std::vector< double > positions_
boost::regex header_re
Boost regular expressions implementing the grammar.
ReturnMatrix copy(const Eigen::MatrixBase< Matrix > &mat)
void parse_joint_names(std::string &text, std::string &sub_text1, std::vector< std::string > &joint_names)
Understand joint_names. Extract a list of strings.
std::string comma_pt_str_re
bool parse_point(std::string &trajectory, std::string &sub_text1)
Extract a point description.
Trajectory & TrajectoryToFill_
bool parse_seq(std::string &text, std::string &sub_text1, std::vector< double > &seq)
Extract a sequence of doubles. To be used for position, velocities, accelerations and effort.
std::vector< double > efforts_
std::vector< std::string > joint_names_
std::vector< double > velocities_
bool parse_points(std::string &trajectory, std::string &sub_text1)
Extract a sequence of points.
std::string bg_liste_of_pts_str_re
timestamp & operator=(const timestamp &other)
std::vector< double > vec_ref
std::vector< std::string > joint_names
friend std::ostream & operator<<(std::ostream &stream, const timestamp &ats)
std::string list_of_jn_str_re
void parse_string(std::string &atext)
parse_string will fill TrajectoryToFill with string atext.
void transfer(const std::vector< double > &src, std::size_t vecId)
timestamp(const timestamp &ats)
std::vector< JointTrajectoryPoint > points_
std::string list_of_pv_str_re
std::string float_str_re
Strings specifying the grammar of the structure.
std::string timestamp_str_re
std::string frame_id_str_re
boost::regex list_of_jn_re
timestamp(unsigned long int lsecs, unsigned long int lnsecs)
std::string header_str_re
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32