17 #ifndef __sot_torque_control_simple_inverse_dyn_H__
18 #define __sot_torque_control_simple_inverse_dyn_H__
25 #if defined(simple_inverse_dyn_EXPORTS)
26 #define SOTSIMPLEINVERSEDYN_EXPORT __declspec(dllexport)
28 #define SOTSIMPLEINVERSEDYN_EXPORT __declspec(dllimport)
31 #define SOTSIMPLEINVERSEDYN_EXPORT
40 #include "boost/assign.hpp"
43 #include <pinocchio/multibody/model.hpp>
44 #include <pinocchio/parsers/urdf.hpp>
45 #include <tsid/contacts/contact-6d.hpp>
46 #include <tsid/formulations/inverse-dynamics-formulation-acc-force.hpp>
47 #include <tsid/robots/robot-wrapper.hpp>
48 #include <tsid/solvers/solver-HQP-base.hpp>
49 #include <tsid/tasks/task-com-equality.hpp>
50 #include <tsid/tasks/task-joint-posture.hpp>
51 #include <tsid/trajectories/trajectory-euclidian.hpp>
53 #include "pinocchio/algorithm/joint-configuration.hpp"
56 #include <dynamic-graph/signal-helper.h>
58 #include <sot/core/matrix-geometry.hh>
59 #include <sot/core/robot-utils.hh>
79 :
public ::dynamicgraph::Entity {
81 DYNAMIC_GRAPH_ENTITY_DECL();
84 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
128 dynamicgraph::Vector);
139 void init(
const double& dt,
const std::string& robotRef);
140 virtual void setControlOutputType(
const std::string& type);
141 void updateComOffset();
144 virtual void display(std::ostream& os)
const;
146 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
147 const char* =
"",
int = 0) {
148 logger_.stream(t) << (
"[" + name +
"] " + msg) <<
'\n';
165 tsid::InverseDynamicsFormulationAccForce*
m_invDyn;
double m_w_com
Weights of the Tasks (which can be changed)
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
tsid::tasks::TaskComEquality * m_taskCom
DECLARE_SIGNAL_IN(kp_com, dynamicgraph::Vector)
tsid::tasks::TaskSE3Equality * m_taskWaist
DECLARE_SIGNAL_IN(w_posture, double)
bool m_firstTime
True if controler is enabled.
DECLARE_SIGNAL_IN(com_ref_pos, dynamicgraph::Vector)
tsid::solvers::SolverHQPBase * m_hqpSolver
Solver and problem formulation.
DECLARE_SIGNAL_IN(kp_posture, dynamicgraph::Vector)
tsid::tasks::TaskJointPosture * m_taskBlockedJoints
DECLARE_SIGNAL_IN(kp_waist, dynamicgraph::Vector)
unsigned int m_timeLast
3d CoM offset
DECLARE_SIGNAL_IN(kd_waist, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(kd_posture, dynamicgraph::Vector)
RobotUtilShrPtr m_robot_util
Final time of the control loop.
DECLARE_SIGNAL_OUT(q_des, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(active_joints, dynamicgraph::Vector)
bool m_enabled
true if the entity has been successfully initialized
tsid::math::Vector m_dv_sot
Computed solutions (accelerations and torques) and their derivatives.
double m_t
control loop time period
DECLARE_SIGNAL_OUT(u, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(waist_ref_acc, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(kd_pos, dynamicgraph::Vector)
tsid::InverseDynamicsFormulationAccForce * m_invDyn
DECLARE_SIGNAL_OUT(v_des, dynamicgraph::Vector)
tsid::math::Vector m_v_urdf
desired velocities (sot order)
tsid::robots::RobotWrapper * m_robot
True at the first iteration of the controller.
DECLARE_SIGNAL_IN(waist_ref_vel, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(posture_ref_acc, dynamicgraph::Vector)
DECLARE_SIGNAL_INNER(active_joints_checked, dynamicgraph::Vector)
mask with 1 for controlled joints, 0 otherwise
DECLARE_SIGNAL_IN(kd_contact, dynamicgraph::Vector)
tsid::math::Vector m_tau_sot
DECLARE_SIGNAL_OUT(tau_des, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(kp_contact, dynamicgraph::Vector)
tsid::math::Vector m_q_urdf
desired positions (sot order)
tsid::math::Vector m_q_sot
DECLARE_SIGNAL_IN(posture_ref_vel, dynamicgraph::Vector)
tsid::math::Vector m_v_sot
desired accelerations (urdf order)
DECLARE_SIGNAL_IN(kd_com, dynamicgraph::Vector)
tsid::trajectories::TrajectorySample m_samplePosture
DECLARE_SIGNAL_IN(kp_pos, dynamicgraph::Vector)
DECLARE_SIGNAL_OUT(dv_des, dynamicgraph::Vector)
tsid::trajectories::TrajectorySample m_sampleCom
Trajectories of the tasks.
DECLARE_SIGNAL_IN(contact_points, dynamicgraph::Matrix)
bool m_initSucceeded
current time
tsid::math::Vector m_dv_urdf
desired accelerations (sot order)
DECLARE_SIGNAL_IN(com_ref_vel, dynamicgraph::Vector)
tsid::contacts::Contact6d * m_contactRF
TASKS.
tsid::contacts::Contact6d * m_contactLF
tsid::math::Vector3 m_com_offset
desired torques (sot order)
DECLARE_SIGNAL_IN(w_com, double)
DECLARE_SIGNAL_IN(posture_ref_pos, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(q, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(f_max, double)
ControlOutput m_ctrlMode
Share pointer to the robot utils methods.
DECLARE_SIGNAL_IN(f_min, double)
DECLARE_SIGNAL_IN(mu, double)
DECLARE_SIGNAL_IN(contact_normal, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(w_waist, double)
DECLARE_SIGNAL_IN(w_forces, double)
DECLARE_SIGNAL_IN(waist_ref_pos, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(com_ref_acc, dynamicgraph::Vector)
tsid::tasks::TaskJointPosture * m_taskPosture
DECLARE_SIGNAL_IN(v, dynamicgraph::Vector)
tsid::trajectories::TrajectorySample m_sampleWaist
const std::string ControlOutput_s[]
AdmittanceController EntityClassName
Eigen::Matrix< double, 3, 1 > Vector3
@ CONTROL_OUTPUT_VELOCITY
#define SOTSIMPLEINVERSEDYN_EXPORT