Wiki

Clone wiki

srcsim / qual_task2

Overview

SRC qualification 2 is a locomotion and basic manipulation task. The qualification loads with R5 standing in front of a doorway with a closed door and a red button.

You must walk close to the red button, press it, and cross the doorway once the door opens. Score is based on your ability to press the button, walking through the doorway, where R5 must walk one meter beyond the door without falling, and the time required to complete the task.

There is a line in front of the initial position of R5. When you cross this starting line your task will start. At one meter after the doorway there is a second line. Crossing this finish line will finish the task.

Start line Finish line
SRC_qual2_start.jpg SRC_qual2_finish.jpg

Quick Start

  1. Open a new terminal and source the configuration file:

    source /opt/nasa/indigo/setup.bash

  2. Run qual task 2 simulation

    roslaunch srcsim qual2.launch extra_gazebo_args:="-r" init:="true" grasping_init:="true"

  3. Write your solution

  4. Rerun the qual 2 task along with your solution.

  5. Submit your log file as detailed in section Upload your log file below

2D image processing

Please, refer to the qualification 1 documentation for a description of how to process your camera images.

Walking

The SRCSim API provides a set of ROS messages that can be used to control the walking of your robot. In this tutorial, we'll use a helper script to demonstrate how to start a multi-step behavior. Once your robot is ready standing in front of the doorway, execute the following command in a new terminal (first make sure that you have ros-indigo-rosbash installed):

source /opt/ros/indigo/setup.bash
rosrun srcsim walk_test.py

The robot should start walking a few steps.

Arm control

The SRCSim API provides a set of ROS messages that can be used to control the arms of your robot. In this tutorial, we'll use a helper script to demonstrate how to move an arm.

Open a new terminal and configure the environment:

source /opt/ros/indigo/setup.bash

Download the script for testing the arm control:

wget goo.gl/dSYWfW -O /tmp/armDemo.py

Once your robot is ready standing in front of the doorway, execute the following command in a new terminal:

python /tmp/armDemo.py

You should see the right arm of your robot moving.

For more information about controlling the arm and the fingers using a keyboard, please see the grasping tutorial.

Upload your log file

You need to add the parameter extra_gazebo_args:="-r" to roslaunch for enabling Gazebo logging. When you're ready to start your SRC task with logging enable, type:

roslaunch srcsim qual2.launch extra_gazebo_args:="-r" init:="true" grasping_init:="true"

A log file is written at ~/.gazebo/log/<timestamp>/gzserver/state.log . You can verify that your log file has been properly generated by loading it into Gazebo:

gazebo -p ~/.gazebo/log/<timestamp>/gzserver/state.log

It's highly recommended to playback your log files before submission. You can do it as follows (the lights won't flash while playing back the log):

roscore & rosrun gazebo_ros gazebo -p ~/.gazebo/log/<timestamp>/gzserver/state.log 

The size of a log file can be really big depending on the complexity of the world. For submission, we'll reduce the size of the log file by sampling at lower rate and filtering some of the information. Run the following command inside the folder where your log file was created.

gz log -e -f state.log --filter *.pose/*.pose -z 60 > qual_2.log

And then, compress your file:

gzip -c qual_2.log > qual_2.log.gz

Always save the original log and submit the filtered log (qual_2.log.gz).

Check your score

A script to test answers is being made available to the teams. We encourage teams to check their answers before submission to make sure that your log file is correct and your answers looks reasonable.

Note: The scoring files are only meant to aid in debugging. They do not reflect the real score.

Create a directory for storing the scoring scripts:

mkdir ~/srcsim_score && cd ~/srcsim_score

Download the following ruby scripts:

wget https://bitbucket.org/osrf/srcsim/raw/score/scoring/common.rb
wget https://bitbucket.org/osrf/srcsim/raw/score/scoring/scoring_q2.rb

Install the following dependencies:

sudo apt-get install ruby-nokogiri

The next step is to prepare your log file to be used with the scoring script. The default log files are compressed to reduce its size but the scoring scripts need uncompressed log files. Replace <timestamp> with your appropriate directory name:

gz log -e -f ~/.gazebo/log/<timestamp>/gzserver/state.log > ~/.gazebo/log/<timestamp>/gzserver/qual_2.log

Make the scoring script executable:

chmod +x scoring_q2.rb

And check your score:

./scoring_q2.rb ~/.gazebo/log/<timestamp>/gzserver/qual_2.log

The output of the script should tell you the time where the robot crossed the starting and finish line, as well as the elapsed task time.

Start line crossed: [63 254000000]
Finish line crossed: [117 224000000]
Elapsed time: [53 970000000]

Updated