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
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_motors number of actuated motors filename_start name of file with joint actuations for start phase filename_cycle name of file with joint actuations for cycle phase filename_stop name of file with joint actuations for stop phase repeat true 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_pose time to transition to initial pose (duration of POSE phase) time_hold time 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