Skip to content

Topic/task contact force energy #85

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

Open
wants to merge 53 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
27bac45
[Angular Momentum] Add AM task in inverse-dynamic-balance-controller …
Apr 6, 2020
9951391
[Inv_Dyn] Update references of contacts when they are added
Apr 6, 2020
c1671d1
[Base-estim] Plug base-estimator to inv_dyn entity to have updates on…
May 12, 2020
e233250
[Doc] Add documentation for walk and bellStep simulation
May 25, 2020
c05584c
[Inv_Dyn] Clean useless sendMsg
May 25, 2020
15c85a6
[DDP] Add ddp files to plugin list
May 25, 2020
1382c0a
[Inv_Dyn] Add control mode (vel/torque) and change signal phase (int)
Jun 16, 2020
30ff3c6
[Inv_Dyn] Wrong init size for m_q_sot (39 -> 38)
Jun 16, 2020
da0fd7d
[Angular Momentum] Add AM task in inverse-dynamic-balance-controller …
Apr 6, 2020
8766480
[Inv_Dyn] Update references of contacts when they are added
Apr 6, 2020
6629e64
[Base-estim] Plug base-estimator to inv_dyn entity to have updates on…
May 12, 2020
2e8ba0f
[Doc] Add documentation for walk and bellStep simulation
May 25, 2020
d5ff701
[Inv_Dyn] Clean useless sendMsg
May 25, 2020
4468508
[DDP] Add ddp files to plugin list
May 25, 2020
501baec
[Inv_Dyn] Add control mode (vel/torque) and change signal phase (int)
Jun 16, 2020
479e4aa
[Inv_Dyn] Wrong init size for m_q_sot (39 -> 38)
Jun 16, 2020
cd75739
Merge remote-tracking branch 'origin/topic/tsid_am_task' into topic/t…
Jul 31, 2020
ccda8eb
[Inv_Dyn] Add com_admittance references for tasks on CoM in velocity …
Jul 31, 2020
0b0aa52
[param-server] Fix includes for boost in robot-utils of sot-core
Aug 10, 2020
1043c80
[Inv_Dyn] Fix wrong sendMsg type (ERROR to INFO)
Jul 31, 2020
d895244
[Inv_Dyn] Add DCM & AM signal outputs + acceleration ref to taskComAdm
Nov 4, 2020
a1f38cd
[Inv_Dyn] Change formulation of the PD+
Nov 4, 2020
484eea6
[Inv_Dyn] Add function actFrame to transform the CoM and Feet frames
Nov 4, 2020
597101c
Merge remote-tracking branch 'gh_stack/release/1.6.0' into topic/icra…
Nov 5, 2020
91057f4
Missing include of robot-utils.hh
Nov 5, 2020
99b0df4
[Inv_Dyn] Add torque bounds constraint + add feet quaternion signals
NoelieRamuzat Mar 8, 2021
4780a89
[Inv_Dyn] Remove transformFrame on CoM and feet for Isabelle trajectory
NoelieRamuzat Mar 10, 2021
46b5f30
Merge remote-tracking branch 'gh_stack/devel' into topic/isabelle
Mar 22, 2021
2121603
[Test] remove useless headers
Mar 24, 2021
823f7d7
[Posture_task] Add a simple entity with only a posture task
Mar 25, 2021
2d09c13
[Posture_Task] Add constraint torque limits
Mar 26, 2021
a5d661f
Fix Gains in contact6D because of changes in TSID
Mar 29, 2021
0a4b8cf
[Posture_Task] Add contact6D
Mar 29, 2021
3d2f536
Correction on contact6D gains
Mar 30, 2021
c53282a
[SimpleInvDyn] Add actuation bounds constraint
Mar 30, 2021
5ff9478
[Energy] Cherrypick commit branch topic/energy
Mar 30, 2021
2034bc8
[Energy] Add smoothness coefficients
Jul 16, 2021
e7a8ce9
[ForceTask] First draft
Jul 21, 2021
4b08c57
[Energy] Add energy task in posture simu and add energy signals
Jul 27, 2021
7b4893f
[ForceTask] Add command to add/remove force task on left hand
Jul 28, 2021
3e9d600
[ForceTask] Add signal LHForce_world and fix frame name and gains
Aug 4, 2021
839926d
[Posture Task] Add waist task in pb
Aug 4, 2021
4517a62
[Debug] Add signal waist orientation
Aug 4, 2021
92afc94
[Debug] Norm error of waist task
Aug 4, 2021
9eca3af
[Posture Task] Add waist task in pb
Aug 6, 2021
66cfef0
[ForceTask] Set force in tool frame - use contact6D
Aug 10, 2021
2b04751
Merge remote-tracking branch 'origin/topic/task_energy' into topic/ta…
Aug 10, 2021
e6835ac
Comment useless signal
Aug 6, 2021
69fdbf1
Merge remote-tracking branch 'gh_stack/devel' into topic/task_contact…
Aug 24, 2021
42fa1e5
[Energy] Clean files
Sep 14, 2021
1f1aaba
Refactor TrajectorySample::pos, vel, acc as in TSID - Clean energy & …
Jan 20, 2022
a695afc
Merge remote-tracking branch 'gh_stack/devel' into topic/task_contact…
Jan 20, 2022
dc1be02
Fix send message
Jan 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ SET(${PROJECT_NAME}_HEADERS
include/${CUSTOM_HEADER_DIR}/se3-trajectory-generator.hh
include/${CUSTOM_HEADER_DIR}/free-flyer-locator.hh
include/${CUSTOM_HEADER_DIR}/inverse-dynamics-balance-controller.hh
include/${CUSTOM_HEADER_DIR}/simple-inverse-dyn.hh
include/${CUSTOM_HEADER_DIR}/posture-task.hh
include/${CUSTOM_HEADER_DIR}/position-controller.hh
include/${CUSTOM_HEADER_DIR}/control-manager.hh
include/${CUSTOM_HEADER_DIR}/current-controller.hh
Expand Down
6 changes: 5 additions & 1 deletion doc/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Pay attention not to install ROS using robotpkg though, because it would install

You can find the full installation procedure in the <a href="md_doc_installation.html">installation page</a>.

Quick instructions on how to run a test can be found <a href="md_doc_running.html">here</a>.
Instructions for running a simulation of Pyrene executing a CoM sinusoid in position or torque control can be found <a href="md_doc_running.html">here</a>.

Instructions for running a simulation or an experiment using the DDP on the right elbow of Pyrene can be found <a href="md_doc_ddpRun.html">here</a>.

Instructions for running a simulation of Pyrene executing a foot sinusoid in the air in torque control can be found <a href="md_doc_bellStepRun.html">here</a>.

Instructions for running a simulation of Pyrene walking in torque control can be found <a href="md_doc_walkRun.html">here</a>.
40 changes: 40 additions & 0 deletions doc/bellStepRun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Pyrene step in the air in torque control

In the following, we demonstrate how to run the foot sinusoid simulation with <a href="https://github.com/stack-of-tasks/sot-torque-control">sot-torque-control</a>, and talos-torque-control.

## Start the simulation

Start the simulation with the robot in the half-sitting position:
```
roslaunch talos_data talos_gazebo.launch start_half_sitting:=true
```

## Start the SoT in torque mode

To start the SoT in simulation in torque mode:
```
roslaunch roscontrol_sot_talos sot_talos_controller_gazebo_effort.launch
```

## Run the test

First of all, you need to go to the folder where your script is.
For running the ddp test of talos-torque-control, assuming you are in the root directory:

```
cd script
```

Then, you can just run the test :

```
python sim_torque_bellStep.py
```

This will launch the simulation making the robot executing a sinusoid movement of its left foot in the air (a "bell step") in torque control.

The script also saves the dynamic graph in /tmp/sot_talos_tsid_bellStep.pdf.

## Other

More information on how to use the SoT and how to work on Talos can be found <a href="https://wiki.laas.fr/robots/Pyrene">in the robot wiki page</a> (you need LAAS permissions to access this).
2 changes: 1 addition & 1 deletion doc/running.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Running a test
# Pyrene CoM sinusoid in position or torque control

In the following, we quickly demonstrate how to run a test with sot-torque-control and <a href="https://gitlab.laas.fr/pyrene-dev/talos-torque-control.git">talos-torque-control</a>.

Expand Down
59 changes: 59 additions & 0 deletions doc/walkRun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Make Pyrene walk in torque control (quasistatic trajectories)

In the following, we demonstrate how to run the walking simulation with <a href="https://github.com/stack-of-tasks/sot-torque-control">sot-torque-control</a>, and talos-torque-control; using the reference quasistatic trajectories computed by <a href="https://github.com/loco-3d/multicontact-api">multicontact-api</a>.

## Start the simulation

Start the simulation with the robot in the half-sitting position:
```
roslaunch talos_data talos_gazebo.launch start_half_sitting:=true
```

## Start the SoT in torque mode

To start the SoT in simulation in torque mode:
```
roslaunch roscontrol_sot_talos sot_talos_controller_gazebo_effort.launch
```

## Run the test

First of all, you need to go to the folder where your script is.
For running the ddp test of talos-torque-control, assuming you are in the root directory:

```
cd script
```

Then, you can just run the test, specifying which type of walk you want the robot to execute (on spot or 20cm steps):

```
Usage: python sim_walk_torque.py walk_type:=[on_spot|walk_20] {path_folder_of_the_reference_trajectories}
```
For instance, for the walk on spot simulation, just run:

```
python sim_walk_torque.py on_spot
```

This will launch the simulation making the robot walk on spot in torque control (for now only a quasistatic movement).

The script also saves the dynamic graph in /tmp/sot_talos_tsid_walk.pdf.

For the 20cm walk just specify "walk_20" instead of "on_spot" in the command line.

If you have some reference trajectories which are not the ones of the talos-torque-control package, you can test them by specifying the absolute path of their folder:

```
python sim_walk_torque.py walk_20 path_to_folder_of_ref_trajectories
```

The trajectories must have a .dat extension and the following names:
* am.dat -> angular momentum trajectory (3D vector to 9D vector if derivatives)
* com.dat -> center of Mass trajectory (3D vector to 9D vector if derivatives)
* leftFoot.dat and rightFoot.dat -> feet trajectories (12D SE3 vector to 36D SE3 vector if derivatives)
* leftForceFoot.dat and rightForceFoot.dat -> feet forces trajectories (6D vector to 18D vector if derivatives)

## Other

More information on how to use the SoT and how to work on Talos can be found <a href="https://wiki.laas.fr/robots/Pyrene">in the robot wiki page</a> (you need LAAS permissions to access this).
12 changes: 4 additions & 8 deletions include/sot/torque_control/admittance-controller.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#include <map>
#include "boost/assign.hpp"

#include <pinocchio/spatial/fwd.hpp>
#include <sot/core/robot-utils.hh>
#include <tsid/robots/robot-wrapper.hpp>
#include <tsid/tasks/task-se3-equality.hpp>

/* HELPER */
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/torque_control/utils/vector-conversions.hh>
#include <map>
#include "boost/assign.hpp"

namespace dynamicgraph {
namespace sot {
Expand Down Expand Up @@ -90,10 +90,6 @@ class SOTADMITTANCECONTROLLER_EXPORT AdmittanceController : public ::dynamicgrap
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[" + name + "] " + msg) << '\n';
}

protected:
Eigen::VectorXd m_u; /// control (i.e. motor currents)
bool m_firstIter;
Expand Down
8 changes: 2 additions & 6 deletions include/sot/torque_control/base-estimator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#include <pinocchio/spatial/fwd.hpp>
#include <sot/core/robot-utils.hh>
#include <map>
#include "boost/assign.hpp"
//#include <boost/random/normal_distribution.hpp>
Expand All @@ -37,7 +38,6 @@
/* HELPER */
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/torque_control/utils/vector-conversions.hh>

namespace dynamicgraph {
Expand Down Expand Up @@ -160,10 +160,6 @@ class SOTBASEESTIMATOR_EXPORT BaseEstimator : public ::dynamicgraph::Entity {
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[" + name + "] " + msg) << '\n';
}

protected:
bool m_initSucceeded; /// true if the entity has been successfully initialized
bool m_reset_foot_pos; /// true after the command resetFootPositions is called
Expand Down
11 changes: 5 additions & 6 deletions include/sot/torque_control/control-manager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#include <pinocchio/spatial/fwd.hpp>
#include <sot/core/robot-utils.hh>
#include <tsid/robots/robot-wrapper.hpp>

#include <map>
#include "boost/assign.hpp"

#include <pinocchio/multibody/model.hpp>
#include <pinocchio/parsers/urdf.hpp>

#include <tsid/robots/robot-wrapper.hpp>

#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/torque_control/utils/vector-conversions.hh>

namespace dynamicgraph {
Expand Down Expand Up @@ -130,10 +133,6 @@ class SOTCONTROLMANAGER_EXPORT ControlManager : public ::dynamicgraph::Entity {
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[ControlManager-" + name + "] " + msg) << '\n';
}

protected:
RobotUtilShrPtr m_robot_util;
tsid::robots::RobotWrapper* m_robot;
Expand Down
13 changes: 5 additions & 8 deletions include/sot/torque_control/current-controller.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@
#include <map>
#include "boost/assign.hpp"

#include <pinocchio/multibody/model.hpp>
#include <pinocchio/parsers/urdf.hpp>

#include <pinocchio/spatial/fwd.hpp>
#include <sot/core/robot-utils.hh>
#include <tsid/robots/robot-wrapper.hpp>
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/torque_control/utils/vector-conversions.hh>

#include <pinocchio/multibody/model.hpp>
#include <pinocchio/parsers/urdf.hpp>

namespace dynamicgraph {
namespace sot {
namespace torque_control {
Expand Down Expand Up @@ -106,10 +107,6 @@ class SOTCURRENTCONTROLLER_EXPORT CurrentController : public ::dynamicgraph::Ent
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[CurrentController-" + name + "] " + msg) << '\n';
}

protected:
RobotUtilShrPtr m_robot_util;
bool m_initSucceeded; /// true if the entity has been successfully initialized
Expand Down
2 changes: 1 addition & 1 deletion include/sot/torque_control/ddp-actuator-solver.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#define SOTDDPACTUATORSOLVER_EXPORT
#endif

#include <sot/core/robot-utils.hh>
#include <tsid/utils/stop-watch.hpp>
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/core/causal-filter.hh>

#include <ddp-actuator-solver/ddpsolver.hh>
Expand Down
2 changes: 1 addition & 1 deletion include/sot/torque_control/ddp_pyrene_actuator_solver.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#include <sot/core/robot-utils.hh>
#include <vector>
#include <tsid/utils/stop-watch.hpp>
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/core/causal-filter.hh>

#include <ddp-actuator-solver/ddpsolver.hh>
Expand Down
7 changes: 2 additions & 5 deletions include/sot/torque_control/device-torque-ctrl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <boost/random/normal_distribution.hpp>
#include <boost/random/variate_generator.hpp>

#include <pinocchio/spatial/fwd.hpp>
#include <sot/core/robot-utils.hh>
#include <tsid/robots/robot-wrapper.hpp>
#include <tsid/tasks/task-se3-equality.hpp>

Expand All @@ -24,7 +26,6 @@

/* HELPER */
#include <dynamic-graph/signal-helper.h>
#include <sot/core/robot-utils.hh>

namespace dgsot = dynamicgraph::sot;

Expand Down Expand Up @@ -75,10 +76,6 @@ class DeviceTorqueCtrl : public dgsot::Device {
virtual void integrate(const double& dt);
void computeForwardDynamics();

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[DeviceTorqueCtrl] " + msg) << '\n';
}

/// \brief Current integration step.
double timestep_;
bool m_initSucceeded;
Expand Down
9 changes: 3 additions & 6 deletions include/sot/torque_control/free-flyer-locator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#include <map>
#include <pinocchio/spatial/fwd.hpp>
#include "boost/assign.hpp"

#include <sot/core/robot-utils.hh>
/* Pinocchio */
#include <pinocchio/multibody/model.hpp>
#include <pinocchio/parsers/urdf.hpp>
Expand All @@ -37,7 +39,6 @@
/* HELPER */
#include <dynamic-graph/signal-helper.h>
#include <sot/core/matrix-geometry.hh>
#include <sot/core/robot-utils.hh>
#include <sot/torque_control/utils/vector-conversions.hh>

namespace dynamicgraph {
Expand Down Expand Up @@ -78,10 +79,6 @@ class SOTFREEFLYERLOCATOR_EXPORT FreeFlyerLocator : public ::dynamicgraph::Entit
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;

void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, const char* = "", int = 0) {
logger_.stream(t) << ("[FreeFlyerLocator-" + name + "] " + msg) << '\n';
}

protected:
bool m_initSucceeded; /// true if the entity has been successfully initialized
pinocchio::Model* m_model; /// Pinocchio robot model
Expand Down
3 changes: 0 additions & 3 deletions include/sot/torque_control/imu_offset_compensation.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,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);
}

protected:
bool m_initSucceeded; /// true if the entity has been successfully initialized
Expand Down
Loading