Skip to content
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

Open
wants to merge 21 commits into
base: devel
Choose a base branch
from

Conversation

NoelieRamuzat
Copy link
Contributor

@NoelieRamuzat NoelieRamuzat commented May 25, 2020

This PR is linked to the one in talos-torque-control (see #10).
Add documentations.

@@ -0,0 +1,59 @@
# Make Pyrene walk in torque control (quasistatic trajectories)

Copy link
Collaborator

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?

Copy link
Contributor Author

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);
}
Copy link
Collaborator

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?

Copy link
Contributor Author

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);
Copy link
Collaborator

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

Copy link
Contributor Author

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);
Copy link
Collaborator

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);
Copy link
Collaborator

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

Copy link
Contributor Author

@NoelieRamuzat NoelieRamuzat Jul 31, 2020

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);
Copy link
Collaborator

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);
Copy link
Collaborator

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);
Copy link
Collaborator

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>

Copy link
Collaborator

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.

Copy link
Contributor Author

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).

@NoelieRamuzat
Copy link
Contributor Author

Travis fails on an error of catkin_init_workspace, I don't know why:
./.travis/../travis_custom/custom_build: line 399: catkin_init_workspace: command not found

@olivier-stasse
Copy link
Member

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
Thanks again for your fixes. I cannot comment them for nom. Maybe @andreadelprete can check your proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants