86 std::size_t
dotPos = filename.find_last_of(
'.');
87 if (
dotPos != std::string::npos) {
89 return filename.substr(
dotPos + 1);
97 std::ifstream file(filename);
100 yError() <<
"Cannot find file" << filename;
110 while (std::getline(file, line))
114 if(!parseCommandLineVarTime(line, njoints))
156 yError(
"Invalid number of elements, expected: %u, read: %u", njoints,
tempElements.size());
159 for (
size_t i = 0; i < njoints;i++)
172bool action_class::parseCommandLineVarTime(std::string
command_line,
size_t njoints)
190 yError(
"Invalid number of elements, expected: %u, read: %u", njoints,
tempElements.size());
193 for (
size_t i = 0; i << njoints;i++)
211std::vector<double> action_class::interpolate_joints(
const std::vector<double>&
q1,
const std::vector<double>&
q2,
double t1,
double t2,
double t)
214 double alpha = (t - t1) / (t2 - t1);
215 for (
size_t i = 0; i <
q1.size(); ++i)
226 yError(
"The vector of actions frames is empty!");
231 yError(
"The timestep cannot be <=0 !");
247 return frame.time < time;
void interpolate_action_frames(double timestep)
bool openFile(std::string filename, size_t njoints, double timestep=-1)
std::deque< action_frame > action_frames_vector
action_frame & operator=(const action_frame &as)
std::vector< double > q_joints
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
An interface to the operating system, including Port based communication.
std::string getFileExtension(const std::string &filename)