Implements the System concept by wrapping the RigidBodyTree algorithms with additional sensors and actuators/forces.
More...
#include <drake/systems/plants/RigidBodySystem.h>
|
template<typename ScalarType > |
using | InputVector = Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 > |
|
template<typename ScalarType > |
using | StateVector = Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 > |
|
template<typename ScalarType > |
using | OutputVector = Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 > |
|
|
| RigidBodySystem (std::shared_ptr< RigidBodyTree > rigid_body_tree) |
|
| RigidBodySystem () |
|
virtual | ~RigidBodySystem () |
|
void | addRobotFromURDFString (const std::string &xml_string, const std::string &root_dir=".", const DrakeJoint::FloatingBaseType floating_base_type=DrakeJoint::ROLLPITCHYAW) |
|
void | addRobotFromURDF (const std::string &urdf_filename, const DrakeJoint::FloatingBaseType floating_base_type=DrakeJoint::QUATERNION, std::shared_ptr< RigidBodyFrame > weld_to_frame=nullptr) |
|
void | addRobotFromSDF (const std::string &sdf_filename, const DrakeJoint::FloatingBaseType floating_base_type=DrakeJoint::QUATERNION, std::shared_ptr< RigidBodyFrame > weld_to_frame=nullptr) |
| Adds the models contained within an SDF file to this rigid body system. More...
|
|
void | addRobotFromFile (const std::string &filename, const DrakeJoint::FloatingBaseType floating_base_type=DrakeJoint::QUATERNION, std::shared_ptr< RigidBodyFrame > weld_to_frame=nullptr) |
|
void | addForceElement (std::shared_ptr< RigidBodyForceElement > f) |
|
void | addSensor (std::shared_ptr< RigidBodySensor > s) |
|
const std::shared_ptr< RigidBodyTree > & | getRigidBodyTree (void) const |
|
size_t | getNumStates () const |
|
size_t | getNumInputs () const |
|
size_t | getNumOutputs () const |
|
int | number_of_positions () const |
| An accessor to the number of position states outputted by this rigid body system. More...
|
|
int | number_of_velocities () const |
| An accessor to the number of velocity states outputted by this rigid body system. More...
|
|
StateVector< double > | dynamics (const double &t, const StateVector< double > &x, const InputVector< double > &u) const |
| dynamics Formulates the forward dynamics of the rigid body system as an optimization find vdot, f (feasibility problem ok for now => implicit objective is min norm solution) subject to position equality constraints (differentiated twice + stabilization): A vdot = b velocity equality constraints (differentiated once + stabilization): A vdot = b forces from joint limits and contact OR contact force constraints on vdot, f. More...
|
|
OutputVector< double > | output (const double &t, const StateVector< double > &x, const InputVector< double > &u) const |
|
bool | isTimeVarying () const |
|
bool | isDirectFeedthrough () const |
|
std::vector< const RigidBodySensor * > | GetSensors () const |
| An accessor to the sensors within this rigid body system. More...
|
|
Implements the System concept by wrapping the RigidBodyTree algorithms with additional sensors and actuators/forces.
Implements the System concept where state is both joint position and velocity.
- Implemented concepts:
- System Concept
using InputVector = Eigen::Matrix<ScalarType, Eigen::Dynamic, 1> |
using OutputVector = Eigen::Matrix<ScalarType, Eigen::Dynamic, 1> |
using StateVector = Eigen::Matrix<ScalarType, Eigen::Dynamic, 1> |
Adds the models contained within an SDF file to this rigid body system.
The models within a particular SDF file can be added multiple times. Each model is uniquely identified by a model ID that is assigned to the rigid bodies that belong to the model.
- Parameters
-
[in] | sdf_filename | The name of the SDF file containing the models to add to this rigid body system. |
[in] | floating_base_type | The type of floating base to use to connect the models within the SDF file to the world. |
[in] | weld_to_frame | The frame used for connecting the models in the SDF to the rigid body tree within this rigid body system. Note that this specifies both the existing frame in the rigid body tree to connect the new models to and the offset from this frame to the new models' root bodies. This is an optional parameter. If it is nullptr , the models within the SDF are connected to the world with zero offset and rotation relative to the world's frame. |
dynamics Formulates the forward dynamics of the rigid body system as an optimization find vdot, f (feasibility problem ok for now => implicit objective is min norm solution) subject to position equality constraints (differentiated twice + stabilization): A vdot = b velocity equality constraints (differentiated once + stabilization): A vdot = b forces from joint limits and contact OR contact force constraints on vdot, f.
can be linear, nonlinear, even complementarity. may have inequalities the trick is that each new constraint can add decision variables (the new constraint forces and/or slack variables) to the problem, so the last constraint to add is equations of motion: H vdot + C(q, qdot, u, f_ext) = J^T(q, qdot) f where J is accumulated through the constraint logic
The solver will then dispatch to the right tool for the job. Note that for many systems, especially those without any contact constraints (or with simple friction models), the formulation is linear and can be solved with least-squares.
size_t getNumInputs |
( |
void |
| ) |
const |
size_t getNumOutputs |
( |
| ) |
const |
size_t getNumStates |
( |
| ) |
const |
const std::shared_ptr<RigidBodyTree>& getRigidBodyTree |
( |
void |
| ) |
const |
|
inline |
An accessor to the sensors within this rigid body system.
This is useful for downstream components to understand the meaning of the output signal of this system.
- Returns
- a const reference to the sensors vector within this rigid body system.
bool isDirectFeedthrough |
( |
| ) |
const |
|
inline |
bool isTimeVarying |
( |
| ) |
const |
|
inline |
int number_of_positions |
( |
| ) |
const |
An accessor to the number of position states outputted by this rigid body system.
int number_of_velocities |
( |
| ) |
const |
An accessor to the number of velocity states outputted by this rigid body system.
The documentation for this class was generated from the following files: