RobWorkProject  23.9.11-
Static Public Member Functions | List of all members
PathLoaderCSV Class Reference

Loader for .csv files. More...

#include <PathLoaderCSV.hpp>

Static Public Member Functions

static rw::trajectory::QPath loadPath (const std::string &file)
 Loads a Path of robot configuration. More...
 
static rw::trajectory::TimedStatePath loadTimedStatePath (const rw::models::WorkCell &workcell, const std::string &file)
 Load a sequence of states for workcell from the file named file. This loader includes timestamps in the path. More...
 
static rw::trajectory::StatePath loadStatePath (const models::WorkCell &workcell, const std::string &file)
 Load a sequence of states for workcell from the file named file. More...
 

Detailed Description

Loader for .csv files.

This loader differs from the standard PathLoader, in that it only considers devices in the workcell.

The .csv format is implemented as follows. First 2 lines is setup:

 3; <- first line is the path length. The loader exist after loading 3 lines of
 configurations.
 6;  <- second line is degrees of freedom (DOF) for all devices in the
 workcell. (Has to match total DOF in workcell).

Then follows the path itself, one configuration-vector at the time:

 -1.5,0.0,-1.5,0.0,-1.5,0.0;
 -1.0,-1.5,0.0,-1.5,0.0,-1.5;
 -0.8,0.0,-1.5,0.0,-1.5,0.0;

If loadTimedStatePath is used, a timestamp (in seconds) is added in the beginning of each line.

If a workcell contains more than 1 device, the first device reads the first n values, second device reads next n values etc.

An example of a file with a path length of 3, DOF of six and a timestamp is given below:

 3;
 6;
 0.0,-1.5,0.0,-1.5,0.0,-1.5,0.0;
 1.0,-1.0,-1.5,0.0,-1.5,0.0,-1.5;
 1.5,-0.8,0.0,-1.5,0.0,-1.5,0.0;

Member Function Documentation

◆ loadPath()

static rw::trajectory::QPath loadPath ( const std::string &  file)
static

Loads a Path of robot configuration.

Load and return a path from a file. Throws an exception if an error occurs

Parameters
file[in] file name
Returns
the path

◆ loadStatePath()

static rw::trajectory::StatePath loadStatePath ( const models::WorkCell workcell,
const std::string &  file 
)
static

Load a sequence of states for workcell from the file named file.

An exception is thrown if the file can't be read or is of the wrong format with respect to the work cell.

◆ loadTimedStatePath()

static rw::trajectory::TimedStatePath loadTimedStatePath ( const rw::models::WorkCell workcell,
const std::string &  file 
)
static

Load a sequence of states for workcell from the file named file. This loader includes timestamps in the path.

An exception is thrown if the file can't be read or is of the wrong format with respect to the work cell.


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