Drake
ManipulatorJointSpaceController Class Reference

This class implements an example of a general purpose controller for a fixed based manipulator based on qp inverse dynamics. More...

#include <drake/examples/qp_inverse_dynamics/manipulator_joint_space_controller.h>

Inheritance diagram for ManipulatorJointSpaceController:
[legend]
Collaboration diagram for ManipulatorJointSpaceController:
[legend]

Public Member Functions

 ManipulatorJointSpaceController (const std::string &model_path, const std::string &alias_group_path, const std::string &controller_config_path, double dt, std::shared_ptr< RigidBodyFrame< double >> world_offset=nullptr)
 Constructs a inverse dynamics controller for a fixed base manipulator that tracks desired generalized position, velocity and acceleration. More...
 
void Initialize (systems::Context< double > *context)
 Initializes the controller's internal state. More...
 
const RigidBodyTreeAliasGroups< double > & get_alias_groups () const
 Returns plan eval's alias groups. More...
 
const systems::controllers::qp_inverse_dynamics::ParamSetget_paramset () const
 Returns plan eval's parameters. More...
 
const systems::InputPortDescriptor< double > & get_input_port_estimated_state () const final
 Returns the input port for estimated state. More...
 
const systems::InputPortDescriptor< double > & get_input_port_desired_state () const final
 Returns the input port for desired state. More...
 
const systems::InputPortDescriptor< double > & get_input_port_desired_acceleration () const
 Returns the input port for desired acceleration. More...
 
const systems::OutputPort< double > & get_output_port_control () const final
 Returns the output port for computed control. More...
 
const systems::OutputPort< double > & get_output_port_plan_eval_debug_info () const
 Returns the output port for a lcm message that contains plan eval's debug data. More...
 
const systems::OutputPort< double > & get_output_port_inverse_dynamics_debug_info () const
 Returns the output port for a lcm message that contains qp inverse dynamics' debug data. More...
 
const systems::OutputPort< double > & get_output_port_qp_input () const
 Returns the output port for QpInput from plan eval. More...
 
const systems::OutputPort< double > & get_output_port_qp_output () const
 Returns the output port for QpOutput from inverse dynamics. More...
 
const RigidBodyTree< double > & get_robot_for_control () const
 Returns a constant reference to the RigidBodyTree used for control. More...
 
- Public Member Functions inherited from StateFeedbackControllerInterface< double >
 StateFeedbackControllerInterface (const StateFeedbackControllerInterface &)=delete
 
 StateFeedbackControllerInterface (StateFeedbackControllerInterface &&)=delete
 
StateFeedbackControllerInterfaceoperator= (const StateFeedbackControllerInterface &)=delete
 
StateFeedbackControllerInterfaceoperator= (StateFeedbackControllerInterface &&)=delete
 
- Public Member Functions inherited from Diagram< double >
 Diagram (const Diagram< U > &other)
 Scalar-converting copy constructor. See System Scalar Conversion. More...
 
 ~Diagram () override
 
std::vector< const systems::System< double > * > GetSystems () const
 Returns the list of contained Systems. More...
 
std::multimap< int, intGetDirectFeedthroughs () const final
 Reports all direct feedthroughs from input ports to output ports. More...
 
std::unique_ptr< CompositeEventCollection< double > > AllocateCompositeEventCollection () const final
 Allocates a DiagramEventCollection for this Diagram. More...
 
std::unique_ptr< Context< double > > AllocateContext () const override
 Allocates a context, initialized with the correct numbers of concrete input ports and state variables for this System. More...
 
void SetDefaultState (const Context< double > &context, State< double > *state) const override
 Assigns default values to all elements of the state. More...
 
void SetDefaultParameters (const Context< double > &context, Parameters< double > *params) const override
 Assigns default values to all parameters. More...
 
void SetRandomState (const Context< double > &context, State< double > *state, RandomGenerator *generator) const override
 Assigns random values to all elements of the state. More...
 
void SetRandomParameters (const Context< double > &context, Parameters< double > *params, RandomGenerator *generator) const override
 Assigns random values to all parameters. More...
 
std::unique_ptr< SystemOutput< double > > AllocateOutput (const Context< double > &context) const override
 Returns a container that can hold the values of all of this System's output ports. More...
 
std::unique_ptr< ContinuousState< double > > AllocateTimeDerivatives () const override
 Aggregates the time derivatives from each subsystem into a DiagramTimeDerivatives. More...
 
std::unique_ptr< DiscreteValues< double > > AllocateDiscreteVariables () const override
 Aggregates the discrete update variables from each subsystem into a DiagramDiscreteVariables. More...
 
void DoCalcTimeDerivatives (const Context< double > &context, ContinuousState< double > *derivatives) const override
 Override this if you have any continuous state variables xc in your concrete System to calculate their time derivatives. More...
 
const ContinuousState< double > * GetSubsystemDerivatives (const ContinuousState< double > &derivatives, const System< double > *subsystem) const
 Retrieves the state derivatives for a particular subsystem from the derivatives for the entire diagram. More...
 
const Context< double > & GetSubsystemContext (const System< double > &subsystem, const Context< double > &context) const
 Returns a constant reference to the subcontext that corresponds to the system subsystem. More...
 
Context< double > & GetMutableSubsystemContext (const System< double > &subsystem, Context< double > *context) const
 Returns the subcontext that corresponds to the system subsystem. More...
 
const CompositeEventCollection< double > & GetSubsystemCompositeEventCollection (const System< double > &subsystem, const CompositeEventCollection< double > &events) const
 Returns the const subsystem composite event collection from events that corresponds to subsystem. More...
 
CompositeEventCollection< double > & GetMutableSubsystemCompositeEventCollection (const System< double > &subsystem, CompositeEventCollection< double > *events) const
 Returns the mutable subsystem composite event collection that corresponds to subsystem. More...
 
State< double > & GetMutableSubsystemState (const System< double > &subsystem, Context< double > *context) const
 Retrieves the state for a particular subsystem from the context for the entire diagram. More...
 
State< double > & GetMutableSubsystemState (const System< double > &subsystem, State< double > *state) const
 Retrieves the state for a particular subsystem from the state for the entire diagram. More...
 
const State< double > & GetSubsystemState (const System< double > &subsystem, const State< double > &state) const
 Retrieves the state for a particular subsystem from the state for the entire diagram. More...
 
void GetPath (std::stringstream *output) const override
 Returns the full path of this Diagram in the tree of Diagrams. More...
 
void EvaluateSubsystemInputPort (const Context< double > *context, const InputPortDescriptor< double > &descriptor) const override
 Evaluates the value of the subsystem input port with the given id in the given context. More...
 
int GetSystemIndexOrAbort (const System< double > *sys) const
 Returns the index of the given sys in this diagram, or aborts if sys is not a member of the diagram. More...
 
 Diagram (const Diagram &)=delete
 
 Diagram (Diagram &&)=delete
 
Diagramoperator= (const Diagram &)=delete
 
Diagramoperator= (Diagram &&)=delete
 
void GetGraphvizFragment (std::stringstream *dot) const override
 Returns a Graphviz fragment describing this Diagram. More...
 
void GetGraphvizInputPortToken (const InputPortDescriptor< double > &port, std::stringstream *dot) const override
 Appends a fragment to the dot stream identifying the graphviz node representing port. More...
 
void GetGraphvizOutputPortToken (const OutputPort< double > &port, std::stringstream *dot) const override
 Appends a fragment to the dot stream identifying the graphviz node representing port. More...
 
- Public Member Functions inherited from System< double >
virtual ~System ()
 
void GetWitnessFunctions (const Context< double > &context, std::vector< const WitnessFunction< double > * > *w) const
 Gets the witness functions active at the beginning of a continuous time interval. More...
 
double EvaluateWitness (const Context< double > &context, const WitnessFunction< double > &witness_func) const
 Evaluates a witness function at the given context. More...
 
std::string GetSystemIdString () const
 Returns a string suitable for identifying this particular System in error messages, when it is a subsystem of a larger Diagram. More...
 
 System (const System &)=delete
 
 System (System &&)=delete
 
Systemoperator= (const System &)=delete
 
Systemoperator= (System &&)=delete
 
std::unique_ptr< BasicVector< double > > AllocateInputVector (const InputPortDescriptor< double > &descriptor) const
 Given a port descriptor, allocates the vector storage. More...
 
std::unique_ptr< AbstractValueAllocateInputAbstract (const InputPortDescriptor< double > &descriptor) const
 Given a port descriptor, allocates the abstract storage. More...
 
std::unique_ptr< Context< double > > CreateDefaultContext () const
 This convenience method allocates a context using AllocateContext() and sets its default values using SetDefaultContext(). More...
 
void SetDefaultContext (Context< double > *context) const
 
void SetRandomContext (Context< double > *context, RandomGenerator *generator) const
 
void AllocateFreestandingInputs (Context< double > *context) const
 For each input port, allocates a freestanding input of the concrete type that this System requires, and binds it to the port, disconnecting any prior input. More...
 
bool HasAnyDirectFeedthrough () const
 Returns true if any of the inputs to the system might be directly fed through to any of its outputs and false otherwise. More...
 
bool HasDirectFeedthrough (int output_port) const
 Returns true if there might be direct-feedthrough from any input port to the given output_port, and false otherwise. More...
 
bool HasDirectFeedthrough (int input_port, int output_port) const
 Returns true if there might be direct-feedthrough from the given input_port to the given output_port, and false otherwise. More...
 
void Publish (const Context< double > &context, const EventCollection< PublishEvent< double >> &events) const
 This method is the public entry point for dispatching all publish event handlers. More...
 
void Publish (const Context< double > &context) const
 Forces a publish on the system, given a context. More...
 
const doubleEvalConservativePower (const Context< double > &context) const
 Returns a reference to the cached value of the conservative power. More...
 
const doubleEvalNonConservativePower (const Context< double > &context) const
 Returns a reference to the cached value of the non-conservative power. More...
 
const Vec< double > * EvalVectorInput (const Context< double > &context, int port_index) const
 Causes the vector-valued input port with the given port_index to become up-to-date, delegating to our parent Diagram if necessary. More...
 
Eigen::VectorBlock< const VectorX< double > > EvalEigenVectorInput (const Context< double > &context, int port_index) const
 Causes the vector-valued input port with the given port_index to become up-to-date, delegating to our parent Diagram if necessary. More...
 
const AbstractValueEvalAbstractInput (const Context< double > &context, int port_index) const
 Causes the abstract-valued input port with the given port_index to become up-to-date, delegating to our parent Diagram if necessary. More...
 
const V * EvalInputValue (const Context< double > &context, int port_index) const
 Causes the abstract-valued input port with the given port_index to become up-to-date, delegating to our parent Diagram if necessary. More...
 
int get_num_constraint_equations (const Context< double > &context) const
 Gets the number of constraint equations for this system using the given context (useful in case the number of constraints is dependent upon the current state (as might be the case with a system modeled using piecewise differential algebraic equations). More...
 
Eigen::VectorXd EvalConstraintEquations (const Context< double > &context) const
 Evaluates the constraint equations for the system at the generalized coordinates and generalized velocity specified by the context. More...
 
Eigen::VectorXd EvalConstraintEquationsDot (const Context< double > &context) const
 Computes the time derivative of each constraint equation, evaluated at the generalized coordinates and generalized velocity specified by the context. More...
 
Eigen::VectorXd CalcVelocityChangeFromConstraintImpulses (const Context< double > &context, const Eigen::MatrixXd &J, const Eigen::VectorXd &lambda) const
 Computes the change in velocity from applying the given constraint forces to the system at the given context. More...
 
double CalcConstraintErrorNorm (const Context< double > &context, const Eigen::VectorXd &error) const
 Computes the norm on constraint error (used as a metric for comparing errors between the outputs of algebraic equations applied to two different state variable instances). More...
 
void CalcTimeDerivatives (const Context< double > &context, ContinuousState< double > *derivatives) const
 Calculates the time derivatives xcdot of the continuous state xc. More...
 
void CalcDiscreteVariableUpdates (const Context< double > &context, const EventCollection< DiscreteUpdateEvent< double >> &events, DiscreteValues< double > *discrete_state) const
 This method is the public entry point for dispatching all discrete variable update event handlers. More...
 
void CalcDiscreteVariableUpdates (const Context< double > &context, DiscreteValues< double > *discrete_state) const
 This method forces a discrete update on the system given a context, and the updated discrete state is stored in discrete_state. More...
 
void CalcUnrestrictedUpdate (const Context< double > &context, const EventCollection< UnrestrictedUpdateEvent< double >> &events, State< double > *state) const
 This method is the public entry point for dispatching all unrestricted update event handlers. More...
 
void CalcUnrestrictedUpdate (const Context< double > &context, State< double > *state) const
 This method forces an unrestricted update on the system given a context, and the updated state is stored in discrete_state. More...
 
double CalcNextUpdateTime (const Context< double > &context, CompositeEventCollection< double > *events) const
 This method is called by a Simulator during its calculation of the size of the next continuous step to attempt. More...
 
void GetPerStepEvents (const Context< double > &context, CompositeEventCollection< double > *events) const
 This method is called by Simulator::Initialize() to gather all update and publish events that are to be handled in StepTo() at the point before Simulator integrates continuous state. More...
 
void CalcOutput (const Context< double > &context, SystemOutput< double > *outputs) const
 Utility method that computes for every output port i the value y(i) that should result from the current contents of the given Context. More...
 
double CalcPotentialEnergy (const Context< double > &context) const
 Calculates and returns the potential energy current stored in the configuration provided in context. More...
 
double CalcKineticEnergy (const Context< double > &context) const
 Calculates and returns the kinetic energy currently present in the motion provided in the given Context. More...
 
double CalcConservativePower (const Context< double > &context) const
 Calculates and returns the rate at which mechanical energy is being converted from potential energy to kinetic energy by this system in the given Context. More...
 
double CalcNonConservativePower (const Context< double > &context) const
 Calculates and returns the rate at which mechanical energy is being generated (positive) or dissipated (negative) other than by conversion between potential and kinetic energy (in the given Context). More...
 
void MapVelocityToQDot (const Context< double > &context, const VectorBase< double > &generalized_velocity, VectorBase< double > *qdot) const
 Transforms a given generalized velocity v to the time derivative qdot of the generalized configuration q taken from the supplied Context. More...
 
void MapVelocityToQDot (const Context< double > &context, const Eigen::Ref< const VectorX< double >> &generalized_velocity, VectorBase< double > *qdot) const
 Transforms the given generalized velocity to the time derivative of generalized configuration. More...
 
void MapQDotToVelocity (const Context< double > &context, const VectorBase< double > &qdot, VectorBase< double > *generalized_velocity) const
 Transforms the time derivative qdot of the generalized configuration q to generalized velocities v. More...
 
void MapQDotToVelocity (const Context< double > &context, const Eigen::Ref< const VectorX< double >> &qdot, VectorBase< double > *generalized_velocity) const
 Transforms the given time derivative qdot of generalized configuration q to generalized velocity v. More...
 
void set_name (const std::string &name)
 Sets the name of the system. More...
 
std::string get_name () const
 Returns the name last supplied to set_name(), or empty if set_name() was never called. More...
 
std::string GetMemoryObjectName () const
 Returns a name for this System based on a stringification of its type name and memory address. More...
 
void GetPath (std::stringstream *output) const
 Writes the full path of this System in the tree of Systems to output. More...
 
std::string GetPath () const
 
int get_num_input_ports () const
 Returns the number of input ports of the system. More...
 
int get_num_output_ports () const
 Returns the number of output ports of the system. More...
 
const InputPortDescriptor< double > & get_input_port (int port_index) const
 Returns the descriptor of the input port at index port_index. More...
 
const OutputPort< double > & get_output_port (int port_index) const
 Returns the output port at index port_index. More...
 
int get_num_constraints () const
 Returns the number of constraints specified for the system. More...
 
const SystemConstraint< double > & get_constraint (SystemConstraintIndex constraint_index) const
 Returns the constraint at index constraint_index. More...
 
bool CheckSystemConstraintsSatisfied (const Context< double > &context, double tol) const
 Returns true if context satisfies all of the registered SystemConstraints with tolerance tol. More...
 
int get_num_total_inputs () const
 Returns the total dimension of all of the input ports (as if they were muxed). More...
 
int get_num_total_outputs () const
 Returns the total dimension of all of the output ports (as if they were muxed). More...
 
void CheckValidOutput (const SystemOutput< double > *output) const
 Checks that output is consistent with the number and size of output ports declared by the system. More...
 
void CheckValidContext (const Context< T1 > &context) const
 Checks that context is consistent for this System template. More...
 
VectorX< doubleCopyContinuousStateVector (const Context< double > &context) const
 Returns a copy of the continuous state vector xc into an Eigen vector. More...
 
void set_parent (const detail::InputPortEvaluatorInterface< double > *parent)
 Declares that parent is the immediately enclosing Diagram. More...
 
std::string GetGraphvizString () const
 Returns a Graphviz string describing this System. More...
 
int64_t GetGraphvizId () const
 Returns an opaque integer that uniquely identifies this system in the Graphviz output. More...
 
void FixInputPortsFrom (const System< double > &other_system, const Context< double > &other_context, Context< double > *target_context) const
 Fixes all of the input ports in target_context to their current values in other_context, as evaluated by other_system. More...
 
const SystemScalarConverterget_system_scalar_converter () const
 (Advanced) Returns the SystemScalarConverter for this object. More...
 
std::unique_ptr< System< AutoDiffXd > > ToAutoDiffXd () const
 Creates a deep copy of this System, transmogrified to use the autodiff scalar type, with a dynamic-sized vector of partial derivatives. More...
 
std::unique_ptr< System< AutoDiffXd > > ToAutoDiffXdMaybe () const
 Creates a deep copy of this system exactly like ToAutoDiffXd(), but returns nullptr if this System does not support autodiff, instead of throwing an exception. More...
 
std::unique_ptr< System< symbolic::Expression > > ToSymbolic () const
 Creates a deep copy of this System, transmogrified to use the symbolic scalar type. More...
 
std::unique_ptr< System< symbolic::Expression > > ToSymbolicMaybe () const
 Creates a deep copy of this system exactly like ToSymbolic(), but returns nullptr if this System does not support symbolic, instead of throwing an exception. More...
 
- Public Member Functions inherited from InputPortEvaluatorInterface< double >
 InputPortEvaluatorInterface ()
 
virtual ~InputPortEvaluatorInterface ()
 
 InputPortEvaluatorInterface (const InputPortEvaluatorInterface &)=delete
 
 InputPortEvaluatorInterface (InputPortEvaluatorInterface &&)=delete
 
InputPortEvaluatorInterfaceoperator= (const InputPortEvaluatorInterface &)=delete
 
InputPortEvaluatorInterfaceoperator= (InputPortEvaluatorInterface &&)=delete
 

Additional Inherited Members

- Public Types inherited from Diagram< double >
typedef std::pair< const System< double > *, intPortIdentifier
 
- Static Public Member Functions inherited from System< double >
static std::unique_ptr< S< AutoDiffXd > > ToAutoDiffXd (const S< double > &from)
 Creates a deep copy of from, transmogrified to use the autodiff scalar type, with a dynamic-sized vector of partial derivatives. More...
 
static std::unique_ptr< S< symbolic::Expression > > ToSymbolic (const S< double > &from)
 Creates a deep copy of from, transmogrified to use the symbolic scalar type. More...
 
- Protected Member Functions inherited from StateFeedbackControllerInterface< double >
 StateFeedbackControllerInterface ()
 
virtual ~StateFeedbackControllerInterface ()
 
- Protected Member Functions inherited from Diagram< double >
 Diagram ()
 Constructs an uninitialized Diagram. More...
 
 Diagram (SystemScalarConverter converter)
 (Advanced) Constructs an uninitialized Diagram. More...
 
double DoEvaluateWitness (const Context< double > &context, const WitnessFunction< double > &witness_func) const final
 For the subsystem associated with witness_func, gets its subcontext from context, passes the subcontext to witness_func' Evaulate method and returns the result. More...
 
void AddTriggeredWitnessFunctionToCompositeEventCollection (const WitnessFunction< double > &witness_func, CompositeEventCollection< double > *events) const final
 For the subsystem associated with witness_func, gets its mutable sub composite event collection from events, and passes it to witness_func's AddEvent method. More...
 
void DoGetWitnessFunctions (const Context< double > &context, std::vector< const WitnessFunction< double > * > *witnesses) const final
 Provides witness functions of subsystems that are active at the beginning of a continuous time interval. More...
 
Context< double > * DoGetMutableTargetSystemContext (const System< double > &target_system, Context< double > *context) const final
 Returns a pointer to mutable context if target_system is a sub system of this, nullptr is returned otherwise. More...
 
const Context< double > * DoGetTargetSystemContext (const System< double > &target_system, const Context< double > *context) const final
 Returns a pointer to const context if target_system is a subsystem of this, nullptr is returned otherwise. More...
 
State< double > * DoGetMutableTargetSystemState (const System< double > &target_system, State< double > *state) const final
 Returns a pointer to mutable state if target_system is a subsystem of this, nullptr is returned otherwise. More...
 
const State< double > * DoGetTargetSystemState (const System< double > &target_system, const State< double > *state) const final
 Returns a pointer to const state if target_system is a subsystem of this, nullptr is returned otherwise. More...
 
CompositeEventCollection< double > * DoGetMutableTargetSystemCompositeEventCollection (const System< double > &target_system, CompositeEventCollection< double > *events) const final
 Returns a pointer to mutable composite event collection if target_system is a subsystem of this, nullptr is returned otherwise. More...
 
const CompositeEventCollection< double > * DoGetTargetSystemCompositeEventCollection (const System< double > &target_system, const CompositeEventCollection< double > *events) const final
 Returns a pointer to const composite event collection if target_system is a subsystem of this, nullptr is returned otherwise. More...
 
void DoMapVelocityToQDot (const Context< double > &context, const Eigen::Ref< const VectorX< double >> &generalized_velocity, VectorBase< double > *qdot) const override
 The generalized_velocity vector must have the same size and ordering as the generalized velocity in the ContinuousState that this Diagram reserves in its context. More...
 
void DoMapQDotToVelocity (const Context< double > &context, const Eigen::Ref< const VectorX< double >> &qdot, VectorBase< double > *generalized_velocity) const override
 The generalized_velocity vector must have the same size and ordering as the generalized velocity in the ContinuousState that this Diagram reserves in its context. More...
 
void DoCalcNextUpdateTime (const Context< double > &context, CompositeEventCollection< double > *event_info, double *time) const override
 Computes the next update time based on the configured actions, for scalar types that are arithmetic, or aborts for scalar types that are not arithmetic. More...
 
BasicVector< double > * DoAllocateInputVector (const InputPortDescriptor< double > &descriptor) const override
 Allocates an input vector of the leaf type that the System requires on the port specified by descriptor. More...
 
AbstractValueDoAllocateInputAbstract (const InputPortDescriptor< double > &descriptor) const override
 Allocates an abstract input of the leaf type that the System requires on the port specified by descriptor. More...
 
- Protected Member Functions inherited from System< double >
SystemConstraintIndex AddConstraint (std::unique_ptr< SystemConstraint< double >> constraint)
 Adds an already-created constraint to the list of constraints for this System. More...
 
const EventCollection< PublishEvent< double > > & get_forced_publish_events () const
 
const EventCollection< DiscreteUpdateEvent< double > > & get_forced_discrete_update_events () const
 
const EventCollection< UnrestrictedUpdateEvent< double > > & get_forced_unrestricted_update_events () const
 
void set_forced_publish_events (std::unique_ptr< EventCollection< PublishEvent< double >>> forced)
 
void set_forced_discrete_update_events (std::unique_ptr< EventCollection< DiscreteUpdateEvent< double >>> forced)
 
void set_forced_unrestricted_update_events (std::unique_ptr< EventCollection< UnrestrictedUpdateEvent< double >>> forced)
 
 System (SystemScalarConverter converter)
 Constructs an empty System base class object, possibly supporting scalar-type conversion support (AutoDiff, etc.) using converter. More...
 
const InputPortDescriptor< double > & DeclareInputPort (PortDataType type, int size, optional< RandomDistribution > random_type=nullopt)
 Adds a port with the specified type and size to the input topology. More...
 
const InputPortDescriptor< double > & DeclareAbstractInputPort ()
 Adds an abstract-valued port to the input topology. More...
 
void CreateOutputPort (std::unique_ptr< OutputPort< double >> port)
 Adds an already-created output port to this System. More...
 
virtual double DoCalcPotentialEnergy (const Context< double > &context) const
 Override this method for physical systems to calculate the potential energy currently stored in the configuration provided in the given Context. More...
 
virtual double DoCalcKineticEnergy (const Context< double > &context) const
 Override this method for physical systems to calculate the kinetic energy currently present in the motion provided in the given Context. More...
 
virtual double DoCalcConservativePower (const Context< double > &context) const
 Override this method to return the rate at which mechanical energy is being converted from potential energy to kinetic energy by this system in the given Context. More...
 
virtual double DoCalcNonConservativePower (const Context< double > &context) const
 Override this method to return the rate at which mechanical energy is being generated (positive) or dissipated (negative) other than by conversion between potential and kinetic energy (in the given Context). More...
 
virtual int do_get_num_constraint_equations (const Context< double > &context) const
 Gets the number of constraint equations for this system from the given context. More...
 
virtual Eigen::VectorXd DoEvalConstraintEquations (const Context< double > &context) const
 Evaluates the constraint equations for the system at the generalized coordinates and generalized velocity specified by the context. More...
 
virtual Eigen::VectorXd DoEvalConstraintEquationsDot (const Context< double > &context) const
 Computes the time derivative of each constraint equation, evaluated at the generalized coordinates and generalized velocity specified by the context. More...
 
virtual Eigen::VectorXd DoCalcVelocityChangeFromConstraintImpulses (const Context< double > &context, const Eigen::MatrixXd &J, const Eigen::VectorXd &lambda) const
 Computes the change in velocity from applying the given constraint forces to the system at the given context. More...
 
virtual double DoCalcConstraintErrorNorm (const Context< double > &context, const Eigen::VectorXd &error) const
 Computes the norm of the constraint error. More...
 
Eigen::VectorBlock< VectorX< double > > GetMutableOutputVector (SystemOutput< double > *output, int port_index) const
 Returns a mutable Eigen expression for a vector valued output port with index port_index in this system. More...
 
void EvalInputPort (const Context< double > &context, int port_index) const
 Causes an InputPortValue in the context to become up-to-date, delegating to the parent Diagram if necessary. More...
 

Detailed Description

This class implements an example of a general purpose controller for a fixed based manipulator based on qp inverse dynamics.

It contains two main components, plan eval and qp inverse dynamics. Plan eval is responsible for implementing various desired behaviors. It outputs a QpInput struct which is handed to qp inverse dynamics. The latter is responsible for generating torque outputs that best tracks the desired inputs while satisfying all the physical constraints (torque limit, contact maintenance, etc). The biggest advantage for this formulation is that the details of the physical robot is hidden from the behavior level.

This particular example implements a controller that tracks desired generalized position, velocity and acceleration. It is functionally identical to systems::InverseDynamicsController for the unconstrained situations (no torque limits). More advanced behaviors such as end effector tracking in Cartesian space, freeze if unexpected is sensed can be implemented by different plan eval modules.

Constructor & Destructor Documentation

ManipulatorJointSpaceController ( const std::string &  model_path,
const std::string &  alias_group_path,
const std::string &  controller_config_path,
double  dt,
std::shared_ptr< RigidBodyFrame< double >>  world_offset = nullptr 
)

Constructs a inverse dynamics controller for a fixed base manipulator that tracks desired generalized position, velocity and acceleration.

Parameters
model_pathPath to the manipulator model, from which the internal model is instantiated.
alias_group_pathPath to the alias groups file. Used by the controller to understand to topology of the robot.
controller_config_pathPath the config file for the controller.
dtTime step
world_offsetRigidBodyFrame X_WB, where B is the base of the robot.

Here is the call graph for this function:

Member Function Documentation

const RigidBodyTreeAliasGroups<double>& get_alias_groups ( ) const
inline

Returns plan eval's alias groups.

Here is the call graph for this function:

const systems::InputPortDescriptor<double>& get_input_port_desired_acceleration ( ) const
inline

Returns the input port for desired acceleration.

Here is the call graph for this function:

const systems::InputPortDescriptor<double>& get_input_port_desired_state ( ) const
inlinefinalvirtual

Returns the input port for desired state.

Implements StateFeedbackControllerInterface< double >.

Here is the call graph for this function:

const systems::InputPortDescriptor<double>& get_input_port_estimated_state ( ) const
inlinefinalvirtual

Returns the input port for estimated state.

Implements StateFeedbackControllerInterface< double >.

Here is the call graph for this function:

const systems::OutputPort<double>& get_output_port_control ( ) const
inlinefinalvirtual

Returns the output port for computed control.

Implements StateFeedbackControllerInterface< double >.

Here is the call graph for this function:

const systems::OutputPort<double>& get_output_port_inverse_dynamics_debug_info ( ) const
inline

Returns the output port for a lcm message that contains qp inverse dynamics' debug data.

Here is the call graph for this function:

const systems::OutputPort<double>& get_output_port_plan_eval_debug_info ( ) const
inline

Returns the output port for a lcm message that contains plan eval's debug data.

Here is the call graph for this function:

const systems::OutputPort<double>& get_output_port_qp_input ( ) const
inline

Returns the output port for QpInput from plan eval.

Here is the call graph for this function:

const systems::OutputPort<double>& get_output_port_qp_output ( ) const
inline

Returns the output port for QpOutput from inverse dynamics.

Here is the call graph for this function:

const systems::controllers::qp_inverse_dynamics::ParamSet& get_paramset ( ) const
inline

Returns plan eval's parameters.

Here is the call graph for this function:

const RigidBodyTree<double>& get_robot_for_control ( ) const
inline

Returns a constant reference to the RigidBodyTree used for control.

void Initialize ( systems::Context< double > *  context)

Initializes the controller's internal state.

Must be called before execution.

Here is the call graph for this function:


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