HW2 - Gaze

The goal is to follow the ball moving on a table. You will be given two vectors: 1) 'head_direction' - where the robot is looking; 2) 'head_ball_direction' - where the robot should be looking to see the ball. Based on those, your task is to follow the ball with iCub's head.

BRUTE will use its config file, where the GUI is disabled.

Code template hw2.zip
Maximum score 15 (+1)
Deadline 23.3.2025 23:59:59

Submit to BRUTE

How to use the code template

  • insert your code in gaze function in h2w.py
    • do not rename the function
    • do not change parameters of the function
    • you can use other functions inside, but gaze(args) will be called by the evaluation system
      • the variable client of icub_pybullet/pycub.py will be created by the evaluation system. Do not create a new instance of the client inside the function
    • if you did not install the packge then hw2.py should be by default in icub_pybulet/HWs/hw2. You can always change the addition to path in the header of the file or add icub_pybullet to your python path and then it can be anywhere
  • parameters of gaze():
    • client - pyCub instance
    • head_direction - where the robot is looking; numpy array of 3 elements
    • head_ball_direction - where the robot should be looking; numpy array of 3 elements
  • you can use whatever movement type you want and whatever joints of the robot you want

Scoring

  • max 15 points
    • 11 points from automatic evaluation
    • 4 points from manual evaluation
    • 1 bonus point possible for 100% solution
  • Automatic you will be given 15 tests in BRUTE from which the best 11 will be taken to form your score
    • if you pass all 15 tests, you will be given 1 bonus point
    • each tests will run for 10 seconds of random ball movements
      • the evaluation will take 150 seconds + overhead based on the server load, so please expect it to run for 3-5 minutes
    • there are two metrics used:
      • mean absolute error between head_direction and head_ball_direction
        • to get 100% points it needs to be < 0.55deg; for 50% points < 1deg; for 25% points < 5deg
      • max absolute error between head_direction and head_ball_direction
        • to get 100% points it needs to be < 1.25deg; for 75% points < 5deg; for 50% points < 10deg
  • Manual the requirements for your code to get full points are:
    • clean code - no commented lines/blocks of code; reasonable variable names; readable code
    • the computation should be as general as possible, e.g., not a switch for tens of different cases
    • do only the necessary things
    • performance - computations in gaze should as efficient as possible

Requirements:

If you violate any from these, 0 points will be given for the whole HW

  • Submit only the file with the name hw2.py that must include function gaze that takes the same parameters as the gaze function in hw2.py template
  • Do not manipulate the gravity
  • Do not call update_simulation() anywhere
  • All movements must be set with wait=False
courses/hro/hws/hw2.txt · Last modified: 2025/03/04 15:52 by rustlluk