Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ee_cart_imped_control_ns::EECartImpedControlClass Class Reference

Allows a user to control the force or stiffness applied by joints. More...

#include <ee_cart_imped_control.hpp>

Inheritance diagram for ee_cart_imped_control_ns::EECartImpedControlClass:
Inheritance graph
[legend]

List of all members.

Classes

class  EECartImpedData
 Class for storing a trajectory and associated information. More...

Public Member Functions

bool init (pr2_mechanism_model::RobotState *robot, ros::NodeHandle &n)
 Controller initialization in non-realtime.
void starting ()
 Controller startup in realtime.
void stopping ()
 Controller stopping in realtime.
void update ()
 Controller update loop in realtime.

Private Types

typedef std::vector
< ee_cart_imped_msgs::StiffPoint
EECartImpedTraj

Private Member Functions

void commandCB (const ee_cart_imped_msgs::EECartImpedGoalConstPtr &msg)
 Callback when a new goal is received.
double linearlyInterpolate (double time, double startTime, double endTime, double startValue, double endValue)
 Linearly interpolates between trajectory points.
ee_cart_imped_msgs::StiffPoint sampleInterpolation ()
 Samples the interpolation and returns the point the joints should currently be trying to achieve.

Private Attributes

pr2_mechanism_model::Chain chain_
 The chain of links and joints in PR2 language for reference and commanding.
boost::scoped_ptr
< realtime_tools::RealtimePublisher
< ee_cart_imped_msgs::EECartImpedFeedback > > 
controller_state_publisher_
 State publisher, published every 10 updates.
realtime_tools::RealtimeBox
< boost::shared_ptr< const
EECartImpedData > > 
desired_poses_box_
 Desired positions.
KDL::Wrench F_
 Cartesian effort.
KDL::Wrench Fdes_
 Desired Cartesian force.
KDL::Jacobian J_
 Jacobian.
boost::scoped_ptr
< KDL::ChainJntToJacSolver
jnt_to_jac_solver_
 KDL Solver performing the joint angles to Jacobian calculation.
boost::scoped_ptr
< KDL::ChainFkSolverPos
jnt_to_pose_solver_
 KDL Solver performing the joint angles to Cartesian pose calculation.
KDL::Twist Kd_
 Derivative gains.
KDL::Chain kdl_chain_
 The chain of links and joints in KDL language.
KDL::Twist Kp_
 Proportional gains.
double last_goal_starting_time_
 The time at which the goal we saw on the last iteration was started.
ee_cart_imped_msgs::StiffPoint last_point_
 The actual position of the robot when we achieved the last point on the trajectory.
ros::Time last_time_
 Time of the last servo cycle.
ros::NodeHandle node_
KDL::JntArray q_
 Joint positions.
KDL::JntArrayVel qdot_
 Joint velocities.
pr2_mechanism_model::Chain read_only_chain_
 The chain of links and joints in PR2 language for reference only.
pr2_mechanism_model::RobotStaterobot_state_
 The current robot state.
ros::Subscriber subscriber_
KDL::JntArray tau_
 Joint torques.
KDL::JntArray tau_act_
int updates_
 The number of updates to the joint position.
KDL::Frame x_
 Tip pose.
KDL::Frame xd_
 Tip desired pose.
KDL::Twist xdot_
 Cartesian velocity.
KDL::Twist xerr_
 Cartesian error.

Detailed Description

Allows a user to control the force or stiffness applied by joints.

This class contains the realtime controller for controlling joints by stiffness or force. To use this controller, you should use the action wrapper, EECartImpedAction.

Definition at line 41 of file ee_cart_imped_control.hpp.


Member Typedef Documentation

Definition at line 106 of file ee_cart_imped_control.hpp.


Member Function Documentation

Callback when a new goal is received.

Cancels the currently active goal (if there is one), restarts the controller and asks it to execute the new goal.

Parameters:
msgthe new goal

Definition at line 169 of file ee_cart_imped_control.cpp.

Controller initialization in non-realtime.

Initializes the controller on first startup. Prepares the kinematics, pre-allocates the variables, subscribes to command and advertises state.

Parameters:
robotThe current robot state
nA node handle for subscribing and advertising topics
Returns:
True on successful initialization, false otherwise

Implements pr2_controller_interface::Controller.

Definition at line 212 of file ee_cart_imped_control.cpp.

double EECartImpedControlClass::linearlyInterpolate ( double  time,
double  startTime,
double  endTime,
double  startValue,
double  endValue 
) [private]

Linearly interpolates between trajectory points.

Linearly interpolates between startValue and endValue over the time period startTime to endTime of the current goal.

Parameters:
time[seconds] that this goal has been running
startTimetime that the goal began running
endTimetime that the goal should finish running
startValuethe values at the beginning of the interpolation (i.e. the values at startTime)
endValuethe values at the end of the interpolation (i.e. the values at endTime)
Returns:
((time - startTime) * (endValue - startValue) / (endTime - startTime)) + startValue;

Definition at line 13 of file ee_cart_imped_control.cpp.

Samples the interpolation and returns the point the joints should currently be trying to achieve.

Samples the interpolation, using EECartImpedControlClass::linearlyInterpolate, between the current trajectory point and the next trajectory point. Interpolation is done for position and orientation, but not for wrench or stiffness as generally it is desired that wrench or stiffness be constant over a specific trajectory segment.

Returns:
A StiffPoint that is the point the joints should attempt to achieve on this timestep.

Definition at line 24 of file ee_cart_imped_control.cpp.

Controller startup in realtime.

Resets the controller to prepare for a new goal. Sets the desired position and orientation to be the current position and orientation and sets the joints to have maximum stiffness so that they hold their current position.

Hold current position trajectory

Reimplemented from pr2_controller_interface::Controller.

Definition at line 291 of file ee_cart_imped_control.cpp.

Controller stopping in realtime.

Calls EECartImpedControlClass::starting() to lock the joints into their current position.

Reimplemented from pr2_controller_interface::Controller.

Definition at line 502 of file ee_cart_imped_control.cpp.

void EECartImpedControlClass::update ( void  ) [virtual]

Controller update loop in realtime.

A PD controller for achieving the trajectory. Uses EECartImpedControlClass::sampleInterpolation to find the point that should be achieved on the current timestep. Converts this point (which is in Cartesian coordinates) to joint angles and uses a PD update (in the case of stiffness) to send to the joints the correct force.

Implements pr2_controller_interface::Controller.

Definition at line 343 of file ee_cart_imped_control.cpp.


Member Data Documentation

The chain of links and joints in PR2 language for reference and commanding.

Definition at line 50 of file ee_cart_imped_control.hpp.

State publisher, published every 10 updates.

Definition at line 201 of file ee_cart_imped_control.hpp.

realtime_tools::RealtimeBox< boost::shared_ptr<const EECartImpedData> > ee_cart_imped_control_ns::EECartImpedControlClass::desired_poses_box_ [private]

Desired positions.

Definition at line 127 of file ee_cart_imped_control.hpp.

Cartesian effort.

Definition at line 94 of file ee_cart_imped_control.hpp.

Desired Cartesian force.

Definition at line 97 of file ee_cart_imped_control.hpp.

Jacobian.

Definition at line 100 of file ee_cart_imped_control.hpp.

KDL Solver performing the joint angles to Jacobian calculation.

Definition at line 63 of file ee_cart_imped_control.hpp.

KDL Solver performing the joint angles to Cartesian pose calculation.

Definition at line 60 of file ee_cart_imped_control.hpp.

Derivative gains.

Definition at line 140 of file ee_cart_imped_control.hpp.

The chain of links and joints in KDL language.

Definition at line 56 of file ee_cart_imped_control.hpp.

Proportional gains.

Definition at line 137 of file ee_cart_imped_control.hpp.

The time at which the goal we saw on the last iteration was started.

Definition at line 104 of file ee_cart_imped_control.hpp.

The actual position of the robot when we achieved the last point on the trajectory.

Definition at line 131 of file ee_cart_imped_control.hpp.

Time of the last servo cycle.

Definition at line 145 of file ee_cart_imped_control.hpp.

Definition at line 176 of file ee_cart_imped_control.hpp.

Joint positions.

Definition at line 71 of file ee_cart_imped_control.hpp.

Joint velocities.

Definition at line 74 of file ee_cart_imped_control.hpp.

The chain of links and joints in PR2 language for reference only.

Definition at line 53 of file ee_cart_imped_control.hpp.

The current robot state.

Definition at line 47 of file ee_cart_imped_control.hpp.

Definition at line 177 of file ee_cart_imped_control.hpp.

Joint torques.

Definition at line 77 of file ee_cart_imped_control.hpp.

Definition at line 77 of file ee_cart_imped_control.hpp.

The number of updates to the joint position.

Definition at line 205 of file ee_cart_imped_control.hpp.

Tip pose.

Definition at line 81 of file ee_cart_imped_control.hpp.

Tip desired pose.

Definition at line 84 of file ee_cart_imped_control.hpp.

Cartesian velocity.

Definition at line 91 of file ee_cart_imped_control.hpp.

Cartesian error.

Definition at line 88 of file ee_cart_imped_control.hpp.


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


ee_cart_imped_control
Author(s): Mario Bollini, Jenny Barry, and Huan Liu
autogenerated on Sun Jan 5 2014 11:14:41