Skip to content

Latest commit

 

History

History
180 lines (151 loc) · 7.59 KB

README.md

File metadata and controls

180 lines (151 loc) · 7.59 KB

walking-controllers

The walking-controllers project is a suite of modules for achieving bipedal locomotion of the humanoid robot iCub.

The suite includes:

  • Walking_module: this is the main module and it implements all the controller architecture that allows iCub to walk.
  • Joypad_module: this module allows using the Joypad as reference input for the trajectory generated by the Walking Module
  • WalkingLogger_module: an module that can be useful to dump data coming from the Walking Module

Overview

📙 Some theory behind the code

This module allows iCub walking using the position control interface. It implements the following architecture controller_architecture where two controller loops can be distinguished:

Two different inverse kinematics solver are implemented:

  • a standard non-linear IK solver;
  • a standard QP Jacobian based IK solver.

Reference paper

A paper describing some of the algorithms implemented in this repository can be downloaded here. If you're going to use the code developed for your work, please quote it within any resulting publication:

G. Romualdi, S. Dafarra, Y. Hu, D. Pucci "A Benchmarking of DCM Based
Architectures for Position and Velocity Controlled Walking of Humanoid Robots",
2018

The bibtex code for including this citation is provided:

@misc{1809.02167,
Author = {Giulio Romualdi and Stefano Dafarra and Yue Hu and Daniele Pucci},
Title = {A Benchmarking of DCM Based Architectures for Position and Velocity Controlled Walking of Humanoid Robots},
Year = {2018},
Eprint = {arXiv:1809.02167},
}

📄 Dependencies

🔨 Build the suite

Linux/macOs

git clone https://github.com/robotology/walking-controllers.git
cd walking-controllers
mkdir build && cd build
cmake ../
make
[sudo] make install

Notice: sudo is not necessary if you specify the CMAKE_INSTALL_PREFIX. In this case it is necessary to add in the .bashrc or .bash_profile the following lines:

export WalkingControllers_INSTALL_DIR=/path/where/you/installed/
export PATH=$PATH:$WalkingControllers_INSTALL_DIR/bin
export YARP_DATA_DIRS=$YARP_DATA_DIRS:$WalkingControllers_INSTALL_DIR/share/yarp

💻 How to run the simulation

  1. Set the YARP_ROBOT_NAME environment variable according to the chosen Gazebo model:

    export YARP_ROBOT_NAME="icubGazeboSim"
  2. Run yarpserver

    yarpserver --write
  3. Run gazebo and drag and drop iCub (e.g. icubGazeboSim or iCubGazeboV2_5):

    gazebo -slibgazebo_yarp_clock.so
  4. Run yarprobotinterface

     YARP_CLOCK=/clock yarprobotinterface --config launch-wholebodydynamics.xml
  5. Reset the offset of the FT sensors. Open a terminal and write

    yarp rpc /wholeBodyDynamics/rpc
    >> resetOffset all
    
  6. Run the walking module

    YARP_CLOCK=/clock WalkingModule
  7. communicate with the WalkingModule:

    yarp rpc /walking-coordinator/rpc
    

    the following commands are allowed:

    • prepareRobot: put iCub in the home position;
    • startWalking: run the controller;
    • pauseWalking: the controller is paused, you can start again the controller sending startWalking command;
    • stopWalking: the controller is stopped, in order to start again the controller you have to prepare again the robot.
    • setGoal x y: send the desired final position, x and y are expressed in iCub fixed frame.

How to run the Joypad Module

Suppose that you want to run the Joypad application, called WalkingJoypadModule in the same machine where the physical device is connected. The only think that you have to do is running the following command from the terminal

YARP_CLOCK=/clock WalkingJoypadModule

The application will take care to open an SDLJoypad device.

While, if you want to control run the WalkingJoypadModule in a machine that is different form the one where the phisical devce is connected. The JoypadControlServer - JoypadControlClient architecture is required. In details:

  1. Run the JoypadControlServer device in the computer where the joypad is physically connected:

    YARP_CLOCK=/clock yarpdev --device JoypadControlServer --use_separate_ports 1 --period 10 --name /joypadDevice/xbox --subdevice SDLJoypad --sticks 0
    
  2. Run the WalkingJoypadModule in the other computer

    YARP_CLOCK=/clock WalkingJoypadModule --device JoypadControlClient --local /joypadInput --remote /joypadDevice/xbox
    

The Joypad allows you to send all the rpc commands using the buttons. In details:

  • A for preparing the robot
  • B for start walking
  • Y for pause walking
  • X for stop walking

How to dump data

Before run WalkingModule check if dump_data is set to 1

Run the Logger Module

YARP_CLOCK=/clock WalkingLoggerModule

All the data will be saved in the current folder inside a txt named Dataset_YYYY_MM_DD_HH_MM_SS.txt

Some interesting parameters

You can change the DCM controller and the inverse kinematics solver by edit these parameters

🏃 How to test on iCub

You can follows the same instructions of the simulation section without using YARP_CLOCK=/clock. Make sure your YARP_ROBOT_NAME is coherent with the name of the robot (e.g. iCubGenova04)

⚠️ Warning

Currently the supported robots are only:

  • iCubGenova04
  • icubGazeboSim
  • icubGazeboV2_5

Yet, it is possible to use these controllers provided that the robot has V2.5 legs. In this case, the user should define the robot specific configuration files (those of iCubGenova04 are a good starting point).

⚠️ The STRAIN F/T sensors normally mounted on iCub may suffer from saturations due to the strong impacts the robot has with the ground, which may lead to a failure of the controller. It is suggested to use these controllers with STRAIN2 sensors only (as in iCubGenova04) to avoid such saturations.