-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Angular Momentum task & use base-estimator entity to achieve walk in torque control #75
base: devel
Are you sure you want to change the base?
Add Angular Momentum task & use base-estimator entity to achieve walk in torque control #75
Conversation
…entity Try to use it with talos-torque-control package and trajectories from multicontact_api. Works with walk on spot trajectories.
… q/v Remove useless sendMsg functions
@@ -0,0 +1,59 @@ | |||
# Make Pyrene walk in torque control (quasistatic trajectories) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be more appropriate to have this documentation in pyrene-torque-control?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also put it in talos-torque-control. But because there were no example of use of sot-torque-control I also put it here.
But I can remove it :)
@@ -66,9 +66,6 @@ class SOTIMUOFFSETCOMPENSATION_EXPORT ImuOffsetCompensation : public ::dynamicgr | |||
|
|||
/* --- METHODS --- */ | |||
void update_offset_impl(int iter); | |||
void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* file = "", int line = 0) { | |||
logger_.stream(t) << ("[ImuOffsetCompensation-" + name + "] " + msg, t, file, line); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you (re)move the sendMsg methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sendMsg method have been move into the logger.h class of dynamic-graph to be used uniformly by all packages.
It is imported by:
#include <dynamic-graph/signal-helper.h>
which includes:
#include <dynamic-graph/entity.h>
@@ -362,39 +399,41 @@ void InverseDynamicsBalanceController::updateComOffset() { | |||
|
|||
void InverseDynamicsBalanceController::removeRightFootContact(const double& transitionTime) { | |||
if (m_contactState == DOUBLE_SUPPORT) { | |||
SEND_MSG("Remove right foot contact in " + toString(transitionTime) + " s", MSG_TYPE_INFO); | |||
SEND_MSG("Remove right foot contact in " + toString(transitionTime) + " s", MSG_TYPE_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like an error msg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sorry it was for debug purpose I will change this
} | ||
} | ||
|
||
void InverseDynamicsBalanceController::removeLeftFootContact(const double& transitionTime) { | ||
if (m_contactState == DOUBLE_SUPPORT) { | ||
SEND_MSG("Remove left foot contact in " + toString(transitionTime) + " s", MSG_TYPE_INFO); | ||
SEND_MSG("Remove left foot contact in " + toString(transitionTime) + " s", MSG_TYPE_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
bool res = m_invDyn->removeRigidContact(m_contactLF->name(), transitionTime); | ||
if (!res) { | ||
const HQPData& hqpData = m_invDyn->computeProblemData(m_t, m_q_urdf, m_v_urdf); | ||
SEND_MSG("Error while remove right foot contact." + tsid::solvers::HQPDataToString(hqpData, false), | ||
MSG_TYPE_ERROR); | ||
} | ||
const double& w_feet = m_w_feetSIN.accessCopy(); | ||
m_invDyn->addMotionTask(*m_taskLF, w_feet, 1); | ||
m_invDyn->addMotionTask(*m_taskLF, w_feet, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware that the more tasks you add as constraints, the more you risk getting an unfeasible problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree but I achieve better results with this "priority" level in torque control.
However, when I use DCM control to achieve position control (integrate twice the acceleration), I have to put the CoM tasks (-> one for the height and one for the rest) in the cost function.
@@ -432,8 +471,13 @@ void InverseDynamicsBalanceController::addTaskLeftHand(/*const double& transitio | |||
|
|||
void InverseDynamicsBalanceController::addRightFootContact(const double& transitionTime) { | |||
if (m_contactState == LEFT_SUPPORT) { | |||
SEND_MSG("Add right foot contact in " + toString(transitionTime) + " s", MSG_TYPE_INFO); | |||
SEND_MSG("Add right foot contact in " + toString(transitionTime) + " s", MSG_TYPE_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -442,8 +486,13 @@ void InverseDynamicsBalanceController::addRightFootContact(const double& transit | |||
|
|||
void InverseDynamicsBalanceController::addLeftFootContact(const double& transitionTime) { | |||
if (m_contactState == RIGHT_SUPPORT) { | |||
SEND_MSG("Add left foot contact in " + toString(transitionTime) + " s", MSG_TYPE_INFO); | |||
SEND_MSG("Add left foot contact in " + toString(transitionTime) + " s", MSG_TYPE_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
assert(v_robot.size() == static_cast<Eigen::VectorXd::Index>(m_robot_util->m_nbJoints + 6)); | ||
const dg::Vector& com_measured = m_com_measuredSIN(0); | ||
assert(com_measured.size() == 3); | ||
SEND_MSG("COM_measured: " + toString(com_measured), MSG_TYPE_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -25,6 +25,8 @@ | |||
#include <dynamic-graph/factory.h> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to do with this PR but...what's the difference between the inverse-dynamics-balance-controller and this new simple-inverse-dyn? They look rather similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they are similar except that there is no possibility to add motion tasks on the hands or feet.
I created this file to have a simpler control scheme.
I use it to understand the huge inverse-dynamics-balance-controller file.
It is used for simple simulations which make the robot moves its CoM (same behaviour as the ex1 and 2 of the jupyter notebooks).
In velocity control use the base estimator to estimate feet positions and CoM position. Use them in the feet and CoM tasks.
…entity Try to use it with talos-torque-control package and trajectories from multicontact_api. Works with walk on spot trajectories.
… q/v Remove useless sendMsg functions
In velocity control use the base estimator to estimate feet positions and CoM position. Use them in the feet and CoM tasks.
Travis fails on an error of |
Dear @NoelieRamuzat please do not take care of travis output. Right now the output of gitlab.laas.fr is far more informative. During some discussions with @nim65s it is planned to move from travis to github action calling the runner on gitlab.laas.fr |
This PR is linked to the one in talos-torque-control (see #10).
Add documentations.