xpp: xpp_examples | xpp_hyq | xpp_msgs | xpp_quadrotor | xpp_states | xpp_vis

Package Summary

Xpp is collection of packages for the visualization of motion plans for floating-base robots. Apart from drawing support areas, contact forces and motion trajectories in RVIZ, it also displays these plans for specific robots. Current robots include a one-legged, a two-legged hopper, HyQ and a quadrotor.

xpp: xpp_examples | xpp_hyq | xpp_msgs | xpp_quadrotor | xpp_states | xpp_vis

Package Summary

Xpp is collection of packages for the visualization of motion plans for floating-base robots. Apart from drawing support areas, contact forces and motion trajectories in RVIZ, it also displays these plans for specific robots. Current robots include a one-legged, a two-legged hopper, HyQ and a quadrotor.

xpp: xpp_examples | xpp_hyq | xpp_msgs | xpp_quadrotor | xpp_states | xpp_vis

Package Summary

Xpp is collection of packages for the visualization of motion plans for floating-base robots. Apart from drawing support areas, contact forces and motion trajectories in RVIZ, it also displays these plans for specific robots. Current robots include a one-legged, a two-legged hopper, HyQ and a quadrotor.

xpp_teaser.gifxpp_teaser1.gif


https://i.imgur.com/ct8e7T4.png

Getting Started

Just download the precompiled debian for your ros distro (e.g. indigo) and playback the bag files:

$ sudo apt-get update
$ sudo apt-get install ros-[indigo]-xpp
$ roslaunch xpp_examples hyq_bag.launch

Also you can always clone the repo into your catkin workspace and build from source, as described here.

Troubleshooting

In case the above didn't work, make sure your ros packages are up to date, specifically these:

$ sudo apt-get install ros-[indigo]-rviz
$ sudo apt-get install ros-[indigo]-robot-state-publisher

Packages Overview

The core packages that this ROS stack offers are:

  • xpp_states: Classes to define robot states in cartesian and joint space.

  • xpp_msgs: ROS message representation of the above states.

  • xpp_vis: Visualization of states and robots through rviz.

Some optional packages include:

Generating messages

The more involved example trajectories shown have been generated with towr, an optimizer for legged robot motions. However, simple motion plans can also be generated by hand as shown below. This example is taken from xpp_examples/monoped_pub.cc. Run it using

$ roslaunch xpp_examples monoped_ex_generate.launch 

   1 #include <ros/ros.h>
   2 #include <xpp_msgs/RobotStateCartesian.h>
   3 #include <xpp_states/robot_state_cartesian.h>
   4 #include <xpp_states/convert.h>
   5 
   6 using namespace xpp;
   7 
   8 int main(int argc, char *argv[])
   9 {
  10   ros::init(argc, argv, "hopper_publisher");
  11   ros::NodeHandle n;
  12   ros::Publisher state_pub = n.advertise<xpp_msgs::RobotStateCartesian>("state", 1);
  13 
  14   // visualize the state of a one-legged hopper
  15   RobotStateCartesian hopper(1);
  16 
  17   // publishes a sequence of states for a total duration of T spaced 0.01s apart.
  18   double T = 2.0;
  19   double t = 0.0;
  20   double dt = 0.01;
  21   while (t < T)
  22   {
  23     // base and foot follow half a sine motion up and down
  24     hopper.base_.lin.p_.z()        = 0.7 - 0.05*sin(M_PI/T*t);
  25     hopper.ee_motion_.at(0).p_.z() = 0.1*sin(M_PI/T*t);
  26     hopper.ee_forces_.at(0).z()    = 100;  // Newtons
  27     hopper.ee_contact_.at(0)       = true; // leg in contact
  28 
  29     state_pub.publish(Convert::ToRos(hopper));
  30 
  31     ros::spinOnce();
  32     ros::Duration(dt).sleep(); // pause loop so visualization has correct speed.
  33     t += dt;
  34   }
  35 }

Inspection

The visualized trajectories in the rosbags can be easily inspected.

$ roscd xpp_examples/bags/
$ rqt_bag hyq.bag 

Then simply right-click on xpp/state_des and View -> Plot.

https://i.imgur.com/T79RxR6.png

Publications

https://doi.org/10.5281/zenodo.1135005

This software has been used in the following publications:

If you use this work in an academic context, please consider citing the currently released version as shown here.

Feedback

Please let us know your improvement suggestions, bugs or any other issues here.

Wiki: xpp (last edited 2018-04-18 12:55:15 by AlexanderWinkler)