26 #include "Qontrol/Utils/Log.hpp"
27 #include "Qontrol/Utils/Exception.hpp"
28 #include <Eigen/Dense>
34 Eigen::VectorXd joint_position;
35 Eigen::VectorXd joint_velocity;
36 Eigen::VectorXd joint_acceleration;
37 Eigen::VectorXd joint_torque;
38 Eigen::VectorXd external_joint_torque;
40 void resize(
int size) {
41 joint_position.resize(size);
42 joint_velocity.resize(size);
43 joint_acceleration.resize(size);
44 joint_torque.resize(size);
45 external_joint_torque.resize(size);
52 enum RobotModelImplType { PINOCCHIO, KDL };
57 std::string robot_name_;
246 virtual auto getJointGravityTorques() -> Eigen::VectorXd = 0;
281 -> Eigen::Isometry3d = 0;
295 virtual auto getJacobian(
const std::string &body_name) -> Eigen::MatrixXd = 0;
302 virtual auto getJacobian(
const std::string &body_name,
303 const Eigen::Isometry3d &frame)
304 -> Eigen::MatrixXd = 0;
313 -> Eigen::VectorXd = 0;
322 const Eigen::Isometry3d &frame)
323 -> Eigen::VectorXd = 0;
332 -> Eigen::Matrix<double, 6, 1> = 0;
341 const Eigen::Isometry3d &frame)
342 -> Eigen::Matrix<double, 6, 1> = 0;
351 virtual auto getJointAccelerationFromTorques(Eigen::VectorXd torque) -> Eigen::VectorXd = 0;
362 -> Eigen::Matrix<double, 6, 1> = 0;
373 const Eigen::Isometry3d &frame)
374 -> Eigen::Matrix<double, 6, 1> = 0;
384 -> Eigen::Matrix<double, 6, 1> = 0;
394 const Eigen::Isometry3d &frame)
395 -> Eigen::Matrix<double, 6, 1> = 0;
407 -> Eigen::Matrix<double, 6, 1> = 0;
410 const Eigen::Isometry3d &frame)
411 -> Eigen::Matrix<double, 6, 1> = 0;
419 static auto skew(Eigen::Vector3d vector) -> Eigen::Matrix3d;
421 auto integrate(Eigen::VectorXd q,Eigen::VectorXd v,
double dt) -> Eigen::VectorXd;
424 Eigen::VectorXd lower_joint_position_limits;
425 Eigen::VectorXd upper_joint_position_limits;
426 Eigen::VectorXd joint_velocity_limits;
427 Eigen::VectorXd joint_torque_limits;
virtual auto getJointVelocity() -> Eigen::VectorXd
Get the robot current joint velocity.
Definition: GenericModel.cpp:46
void setLowerJointPositionLimits(Eigen::VectorXd lim)
Set the robot lower joint position limits.
Definition: GenericModel.cpp:26
virtual auto getLowerJointPositionLimits() -> Eigen::VectorXd
Get the robot lower joint position limits.
Definition: GenericModel.cpp:34
virtual auto getTipFramePose() -> Eigen::Isometry3d=0
Get the pose of the tip frame wrt. the root frame.
virtual auto getRootFrameName() -> std::string=0
Get the name of the root frame in the model.
Robot state.
Definition: GenericModel.hpp:32
virtual auto getJacobianTimeDerivativeQdot(const std::string &body_name) -> Eigen::VectorXd=0
Get the vector representing the terme in the equation .
void setUpperJointPositionLimits(Eigen::VectorXd lim)
Set the robot upper joint position limits.
Definition: GenericModel.cpp:30
virtual void setJointAcceleration(Eigen::VectorXd joint_acceleration)
Set the robot current joint acceleration.
Definition: GenericModel.cpp:58
virtual auto getFramePose(const std::string &body_name) -> Eigen::Isometry3d=0
Get the pose of the frame called in the URDF wrt. the root frame.
virtual void setJointPosition(Eigen::VectorXd joint_position)
Set the robot current joint position.
Definition: GenericModel.cpp:17
void setJointVelocityLimits(Eigen::VectorXd lim)
Set the robot joint velocity limts.
Definition: GenericModel.cpp:50
auto getJointTorqueLimits() -> Eigen::VectorXd
Get the robot joint torque limits.
Definition: GenericModel.cpp:79
virtual auto getJacobian(const std::string &body_name) -> Eigen::MatrixXd=0
Get the Jacobian matrix expressed at the frame name in the URDF wrt. the root frame.
virtual auto getNrOfDegreesOfFreedom() -> int=0
Get the robot number of degrees of freedom.
static auto skew(Eigen::Vector3d vector) -> Eigen::Matrix3d
compute the skew symetry matrix of a vector. Usefull to perform cross products
Definition: GenericModel.cpp:94
virtual auto getFrameAccelerationFromJointAcceleration(const std::string &body_name) -> Eigen::Matrix< double, 6, 1 >=0
Get the acceleration of the frame named in the URDF wrt. the root frame given the robot current join...
virtual auto getTipFrameVelocity() -> Eigen::Matrix< double, 6, 1 >=0
The twist representing the velocity of the tip frame wrt. the root frame.
virtual auto getInverseJointInertiaMatrix() -> Eigen::MatrixXd=0
Get the matrix representing the inverse of the joint space inertia matrix associated to the term in ...
void setJointTorqueLimits(Eigen::VectorXd lim)
Set the robot joint torque limits.
Definition: GenericModel.cpp:75
void setRobotState(const RobotState &robot_state)
Load the robot model given a urdf path.
Definition: GenericModel.cpp:8
virtual void setJointTorque(Eigen::VectorXd joint_torque)
Set the robot current joint torque.
Definition: GenericModel.cpp:67
virtual auto getJointInertiaMatrix() -> Eigen::MatrixXd=0
Get the matrix representing the joint space inertia matrix associated to the term in the equation of...
virtual void setExternalJointTorque(Eigen::VectorXd external_joint_torque)
Set the robot current external joint torque.
Definition: GenericModel.cpp:84
virtual auto getJointAcceleration() -> Eigen::VectorXd
Get the robot current joint acceleration.
Definition: GenericModel.cpp:62
auto getJointVelocityLimits() -> Eigen::VectorXd
Get the robot joint velocity limts.
Definition: GenericModel.cpp:54
virtual auto getJointPosition() -> Eigen::VectorXd
get the robot current joint position
Definition: GenericModel.cpp:21
virtual void setJointVelocity(Eigen::VectorXd joint_velocity)
Set the robot current joint velocity.
Definition: GenericModel.cpp:42
virtual auto getTipFrameName() -> std::string=0
Get the name of the tip frame in the model.
virtual auto getExternalJointTorque() -> Eigen::VectorXd
Get the robot current external joint torque.
Definition: GenericModel.cpp:89
auto getRobotState() -> RobotState
Get the robot state (position, velocity, acceleration, and external torque)
Definition: GenericModel.cpp:12
virtual auto getUpperJointPositionLimits() -> Eigen::VectorXd
Get the robot upper joint position limits.
Definition: GenericModel.cpp:38
Decalaration of a template specialization for the model library.
Definition: GenericModel.hpp:437
virtual auto getExternalWrench(const std::string &body_name) -> Eigen::Matrix< double, 6, 1 >=0
Get the external wrench applied on the named in the URDF wrt. the root frame given the external join...
virtual auto getFrameAccelerationFromTorques(const std::string &body_name) -> Eigen::Matrix< double, 6, 1 >=0
Get the acceleration of the frame named in the URDF wrt. the root frame given the robot current join...
virtual auto getFrameVelocity(const std::string &body_name) -> Eigen::Matrix< double, 6, 1 >=0
Get the twist representing the velocity of the frame named in the URDF wrt. the root frame.
virtual auto getJointTorque() -> Eigen::VectorXd
Get the robot current joint torque.
Definition: GenericModel.cpp:71
virtual auto getJointCoriolisTorques() -> Eigen::VectorXd=0
Get the vector representing the gravity effect associated to the term in the equation of motion: ....
Definition: GenericModel.hpp:55