Git Product home page Git Product logo

sot-hrprtc-hrp2's Introduction

RTC component to encapsulate the SoT on HRP2

This RTC component will load a dynamic library containing all the control algorithms to generate motion for a humanoid robot.

Prerequisite

We assume that

  • your machine is running ubuntu-10.04,
  • ros-electric-desktop-full is installed in /opt/ros/electric (via apt-get),
  • ros-electric-ros-realtime is installed in /opt/ros/electric,
  • ros-electric-pr2-mechanism is installed in /opt/ros/electric,
  • environment variable DEVEL_DIR should contain an existing directory.
  • environment variable PKG_CONFIG_PATH should contain /opt/grx/lib/pkgconfig

The following packages should be installed in $DEVEL_DIR/install

  • jrl-mathtools,
  • jrl-mal,
  • abstract-robot-dynamics,
  • jrl-dynamics,
  • jrl-walkgen,
  • hrp2-14,
  • hrp2-10,
  • hrp2-dynamics,
  • hrp2-10-optimized,
  • dynamic-graph,
  • dynamic-graph-python,
  • sot-core,
  • sot-dynamics
  • sot-patterngenerator,
  • sot-hrp2.

The following ROS stacks should be installed in $DEVEL_DIR/stacks

  • hrp2
  • redundant_manipulator_control

To install

    mkdir _build-RELEASE
    cd _build-RELEASE
    cmake -DCMAKE_INSTALL_PREFIX=$DEVEL_DIR/install -DCMAKE_BUILD_TYPE=RELEASE -DROBOT=$ROBOT ..
    make
    sudo chmod 777 /opt/grx/lib
    make install

where $ROBOT is HRP2LAAS or HRP2JRL.

Setting the environment variables for the component alone

  1. Make sure that your robot library can be loaded by the component. For that, your LD_LIBRARY_PATH should include $DEVEL_DIR/install/lib/plugin and $DEVEL_DIR/install/lib. Check that libsot-hrp2-14-controller.so (or libsot-hrp2-10-controller.so) is in this latter directory.

  2. Make sure that $DEVEL_DIR/install/lib/python2.6/site-packages is in your PYTHONPATH to access SoT scripts.

Setting the environment variables for and the component inside a hrpsys graph

At the end of file /opt/grx/$ROBOT/bin/config.sh, you should source the following config.sh

    $DEVEL_DIR/config.sh

Be aware that the RTC component resets environment variables. Therefore, the above DEVEL_DIR should be expanded by hand.

The above file should contain the following lines

    export ROS_ROOT=/opt/ros/electric/ros
    export PATH=$ROS_ROOT/bin:$PATH
    export PYTHONPATH=$PYTHONPATH:$ROS_ROOT/core/roslib/src:/opt/grx/HRP2LAAS/script
    export ROS_MASTER_URI=http://localhost:11311

Running the component (with GRX software)

  1. Make sure than ROS is running in a terminal by launching:

    roscore
    
  2. if you are doing simulation launch the simulator (Grx 3.1 simulator for HRP2) and the simulation,

  3. launch /opt/grx/$ROBOT/script/guisot.py,

  4. Click on setup rt-system,

  5. rosrun dynamic_graph_bridge run_command

  6. initialize your control graph

  7. click on Start SoT

Introspection tools for the RTC component

You need to install

will give you the state of the Stack of Task RTC component.

If you want to see the command:

    rtprint /localhost/sot.rtc:qRef

To check the format of the port:

    rtcat -l /localhost/sot.rtc:qRef

sot-hrprtc-hrp2's People

Contributors

florent-lamiraux avatar mehdi-benallegue avatar

Stargazers

Thomas Moulard avatar

Watchers

Guilhem Saurel avatar Olivier Stasse avatar  avatar  avatar Nicolas Mansard avatar Pierre Gergondet avatar James Cloos avatar  avatar Justin Carpentier avatar  avatar Carlos Mastalli avatar Francesco Morsillo avatar Elie Moussy avatar Benjamin Coudrin avatar Metagamer avatar Naveau avatar Thomas Flayols avatar BenWayne182 avatar  avatar  avatar

sot-hrprtc-hrp2's Issues

Controller frequency

Hello

@olivier-stasse @florent-lamiraux
I have some issues defining the frequency of the main control loop.
During my execution, the control loop frequency (ie the delay between two calls of RtcStackOfTasks::onExecute) oscillates between 50 and 100Hz, whereas it should be a fixed 200Hz.
To do this measurement, I have reduced this method to the strict minimum (so that it does not come from the real computation of the control value), aka

RTC::ReturnCode_t RtcStackOfTasks::onExecute(RTC::UniqueId /* ec_id */)
{
captureTime (t1_);
ofs_timing << "startExecute " << getDelay(t0_,t1_) < < std::endl;
captureTime (t0_);
return RTC::RTC_OK;
}

I though the tuning of this frequency could be done in the rtc.conf file, but it is not used since the executable RtcStackOfTasksComp is never run.

In fact, this frequency does not seem to be related to this issue.
Indeed, rtcat indicates that the rate of the sot component is 1000 (aka the default one).

$ rtcat -l /localhost/sot.rtc
[...]
 -Execution Context 0
    State  Stopped
    Kind   Periodic
    Rate   1000.0
    Owner  sot

and trying to force the rate using

  ExecutionContext_ptr ecp = get_context(ec_id);
  ecp->set_rate(200);

changes the rate of the execution context, but not the rate of call to the onExecute method.

Do you have the same problem?
Could you please give me an hint on what I should do to correct this issue?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.