chrono::parsers::ChRobotActuation Class Reference

Description

Generic robot actuation driver using interpolated data from files.

ChRobotActuation takes 3 input files, the lines of which contain a time stamp and values for the motor actuations (equal in number to the number of specified motors). The "cycle" input data file is required, while the "start" and "stop" input files are optional. Within each input data file, time stamps are assumed to start at 0. Actuations at the current time are calculated (through linear interpolation within each data set) each time the Update() function is called.

In the most general case, the robot is assumed to go through the following phases:

1. POSE:
   During this phase (of user-specified duration), the actuations are evolved to the initial pose, defined by the
   first line of the "start" dataset (if it exists, otherwise, the "cycle" dataset).
   This is done by interpolation using a logistic function.
2. HOLD:
   During this phase (of user-specified duration), the robot holds the initial pose.
3. START:
   During this phase, the robot assumes the pose necessary for a particular operation mode.
4. CYCLE:
   This is the main operating phase. This phase can be repeated if so indicated.
5. STOP:
   During this phase, the robot assumes a rest end position.

The different input data files are assumed to be consistent with each other (for example, the end of the "start" dataset must match the beginning of a cycle.

#include <ChRobotActuation.h>

Classes

class  PhaseChangeCallback
 Class to be used as callback interface for user-defined actions at phase changes. More...
 

Public Types

enum  Phase {
  POSE, HOLD, START, CYCLE,
  STOP
}
 Actuation phases. More...
 
typedef std::vector< double > Actuation
 

Public Member Functions

 ChRobotActuation (int num_motors, const std::string &filename_start, const std::string &filename_cycle, const std::string &filename_stop, bool repeat=false)
 Constrauct a robot actuator using the specified input data files. More...
 
void SetVerbose (bool verbose)
 Enable/disable verbose output (default: false).
 
void SetTimeOffsets (double time_pose, double time_hold)
 Specify time intervals to assume and then hold the initial pose (default: 1s, 1s). More...
 
const Actuation & GetActuation () const
 Return the current motor actuations.
 
const std::string & GetCurrentPhase () const
 Return the current phase.
 
void RegisterPhaseChangeCallback (PhaseChangeCallback *callback)
 Register a phase-change callback object.
 
void Update (double time)
 Update internal state of the robot driver.
 

Friends

class RoboSimian
 

Member Enumeration Documentation

◆ Phase

Actuation phases.

Enumerator
POSE 

from design configuration to an initial pose

HOLD 

hold the last configuration

START 

from initial pose to operating pose

CYCLE 

operation (periodic)

STOP 

from operating pose to final pose

Constructor & Destructor Documentation

◆ ChRobotActuation()

chrono::parsers::ChRobotActuation::ChRobotActuation ( int  num_motors,
const std::string &  filename_start,
const std::string &  filename_cycle,
const std::string &  filename_stop,
bool  repeat = false 
)

Constrauct a robot actuator using the specified input data files.

The data files for the "start" and "stop" phases are not required (pass an ampty string).

Parameters
num_motorsnumber of actuated motors
filename_startname of file with joint actuations for start phase
filename_cyclename of file with joint actuations for cycle phase
filename_stopname of file with joint actuations for stop phase
repeattrue if cycle phase is looped

Member Function Documentation

◆ SetTimeOffsets()

void chrono::parsers::ChRobotActuation::SetTimeOffsets ( double  time_pose,
double  time_hold 
)

Specify time intervals to assume and then hold the initial pose (default: 1s, 1s).

Parameters
time_posetime to transition to initial pose (duration of POSE phase)
time_holdtime to hold initial pose (duration of HOLD phase)

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_parsers/ChRobotActuation.h
  • /builds/uwsbel/chrono/src/chrono_parsers/ChRobotActuation.cpp