Attention
This challenge has ended!
This documentation is only for the Real Robot Challenge 2020 which has ended. Following challenges have their own documentation, see the challenge website for more information.
Task-Related Functions¶
The move_cube
module implements functions to sample and validate goals and
compute the reward of a single state for each of the four levels.
These functions are used in our evaluation scripts but you may also use them in your code, e.g. to sample more goals or to compute the reward of a specific pair of achieved and goal state.
-
rrc_simulation.tasks.move_cube.
episode_length
= 3750¶ Number of time steps in one episode (3750 steps per 0.004s = 15s)
-
class
rrc_simulation.tasks.move_cube.
Pose
(position=array([0.0, 0.0, 0.0], dtype=float32), orientation=array([0.0, 0.0, 0.0, 1.0], dtype=float32))[source]¶ Represents a pose given by position and orientation.
-
rrc_simulation.tasks.move_cube.
sample_goal
(difficulty)[source]¶ Sample a goal pose for the cube.
- Parameters
difficulty (int) –
Difficulty level. The higher, the more difficult is the goal. Possible levels are:
1: Random goal position on the table, no orientation.
2: Fixed goal position in the air with x,y = 0. No orientation.
3: Random goal position in the air, no orientation.
4: Random goal pose in the air, including orientation.
- Returns
Goal pose of the cube relative to the world frame. Note that the pose always contains an orientation. For difficulty levels where the orientation is not considered, this is set to
[0, 0, 0, 1]
and will be ignored when computing the reward.- Return type
-
rrc_simulation.tasks.move_cube.
validate_goal
(goal)[source]¶ Validate that the given pose is a valid goal (e.g. no collision)
Raises an error if the given goal pose is invalid.
- Parameters
goal (Pose) – Goal pose.
- Raises
ValueError – If given values are not a valid 3d position/orientation.
InvalidGoalError – If the given pose exceeds the allowed goal space.
-
rrc_simulation.tasks.move_cube.
evaluate_state
(goal_pose, actual_pose, difficulty)[source]¶ Compute cost of a given cube pose. Less is better.
- Parameters
goal_pose – Goal pose of the cube.
actual_pose – Actual pose of the cube.
difficulty – The difficulty level of the goal (see
sample_goal()
). The metric for evaluating a state differs depending on the level.
- Returns
Cost of the actual pose w.r.t. to the goal pose. Lower value means that the actual pose is closer to the goal. Zero if actual == goal.