Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef MOVEIT_DYNAMICS_SOLVER_DYNAMICS_SOLVER_
00038 #define MOVEIT_DYNAMICS_SOLVER_DYNAMICS_SOLVER_
00039
00040
00041 #include <kdl/chain.hpp>
00042 #include <kdl/chainidsolver_recursive_newton_euler.hpp>
00043
00044 #include <moveit/robot_state/robot_state.h>
00045 #include <geometry_msgs/Vector3.h>
00046 #include <geometry_msgs/Wrench.h>
00047
00049 namespace dynamics_solver
00050 {
00051
00057 class DynamicsSolver
00058 {
00059 public:
00060
00068 DynamicsSolver(const robot_model::RobotModelConstPtr &robot_model,
00069 const std::string &group_name,
00070 const geometry_msgs::Vector3 &gravity_vector);
00071
00087 bool getTorques(const std::vector<double> &joint_angles,
00088 const std::vector<double> &joint_velocities,
00089 const std::vector<double> &joint_accelerations,
00090 const std::vector<geometry_msgs::Wrench> &wrenches,
00091 std::vector<double> &torques) const;
00092
00104 bool getMaxPayload(const std::vector<double> &joint_angles,
00105 double &payload,
00106 unsigned int &joint_saturated) const;
00107
00118 bool getPayloadTorques(const std::vector<double> &joint_angles,
00119 double payload,
00120 std::vector<double> &joint_torques) const;
00121
00126 const std::vector<double>& getMaxTorques() const;
00127
00132 const robot_model::RobotModelConstPtr& getRobotModel() const
00133 {
00134 return robot_model_;
00135 }
00136
00137 const robot_model::JointModelGroup* getGroup() const
00138 {
00139 return joint_model_group_;
00140 }
00141
00142 private:
00143
00144 boost::shared_ptr<KDL::ChainIdSolver_RNE> chain_id_solver_;
00145 KDL::Chain kdl_chain_;
00146
00147 robot_model::RobotModelConstPtr robot_model_;
00148 const robot_model::JointModelGroup* joint_model_group_;
00149
00150 robot_state::RobotStatePtr state_;
00151
00152 std::string base_name_, tip_name_;
00153 unsigned int num_joints_, num_segments_;
00154 std::vector<double> max_torques_;
00155
00156 double gravity_;
00157
00158 };
00159
00160 MOVEIT_CLASS_FORWARD(DynamicsSolver);
00161
00162 }
00163 #endif