rosin-project / metacontrol_sim

2 stars 4 forks source link

Test setup for metacontrol (from #31) #32

Closed chcorbato closed 4 years ago

chcorbato commented 4 years ago

(issue created from https://github.com/rosin-project/metacontrol_sim/issues/31#issuecomment-629667596) To test the metacontroller I need to be able to launch the simulation:

marioney commented 4 years ago

I've added a single run script in https://github.com/rosin-project/metacontrol_experiments/commit/bc146cce3cdc0b26fc65b39b4df10cf34bf673b6

@chcorbato can you please give it a test ?

chcorbato commented 4 years ago

Almost! This is the output (things start, but then it dies after the robot starts turning in the initial position I think) I think this is the problem is that a new urdf file is missing:

[INFO] [1589814062.744053, 0.000000]: Adding obstacles.
Traceback (most recent call last):
  File "/home/chcorbato/rosin_paper_ws/src/metacontrol_experiments/scripts/create_unknown_obstacles.py", line 73, in <module>
    with open(os.path.join(rospack.get_path('metacontrol_sim'), "urdf/unknown_obstacle/unknown_obstacle.urdf"), "r") as box_file:
IOError: [Errno 2] No such file or directory: '/home/chcorbato/rosin_paper_ws/src/metacontrol_sim/urdf/unknown_obstacle/unknown_obstacle.urdf'

Complete output:

$ ./run_single_sim.sh 
gzserver not running
Goal position: 1 - Initial position  1 - Navigation profile: 
Launch roscore
Launching: MVP metacontrol world.launch
Launching: mros reasoner
Running log and stop simulation node
... logging to /home/chcorbato/.ros/log/6079ca2c-9918-11ea-bcb4-acbc328abab1/roslaunch-tud0038655-15362.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://tud0038655:38837/

SUMMARY
========

PARAMETERS
 * /create_unknown_obstacles_node/goal_nr: 1
 * /create_unknown_obstacles_node/obstacles: 1
 * /rosdistro: melodic
 * /rosversion: 1.14.5
 * /stop_simulation_node/data_log_folder: /home/chcorbato/r...
 * /stop_simulation_node/store_data_freq: 1.0

NODES
  /
    create_unknown_obstacles_node (metacontrol_experiments/create_unknown_obstacles.py)
    stop_simulation_node (metacontrol_experiments/stop_simulation_node)

ROS_MASTER_URI=http://localhost:11311

process[stop_simulation_node-1]: started with pid [15411]
process[create_unknown_obstacles_node-2]: started with pid [15412]
[ INFO] [1589814061.599549548]: [STOP SIM] - Start node
[ INFO] [1589814061.654514155]: [STOP SIM] Logging to /home/chcorbato/rosin_paper_ws/src/metacontrol_experiments/data/log_Metacontrol_sim_18_05-17_01.csv
[ INFO] [1589814061.654568542]: [STOP SIM] Node Initialization Completed
[ INFO] [1589814061.654594029]: Initialized an async multi-thread node.
[ INFO] [1589814061.654767751]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814061.754866179]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814061.854862958]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814061.955053104]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.054866922]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.154862466]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.254863233]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.354870473]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.454858475]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.554857406]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.654862940]: [STOP SIM] - Wait for goal msg
[INFO] [1589814062.744053, 0.000000]: Adding obstacles.
Traceback (most recent call last):
  File "/home/chcorbato/rosin_paper_ws/src/metacontrol_experiments/scripts/create_unknown_obstacles.py", line 73, in <module>
    with open(os.path.join(rospack.get_path('metacontrol_sim'), "urdf/unknown_obstacle/unknown_obstacle.urdf"), "r") as box_file:
IOError: [Errno 2] No such file or directory: '/home/chcorbato/rosin_paper_ws/src/metacontrol_sim/urdf/unknown_obstacle/unknown_obstacle.urdf'
[ INFO] [1589814062.755308923]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.854857286]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814062.954856998]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.054858138]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.154852971]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.254850556]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.354858915]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.454859783]: [STOP SIM] - Wait for goal msg
[ INFO] [1589814063.554874708]: [STOP SIM] - Wait for goal msg
================================================================================REQUIRED process [create_unknown_obstacles_node-2] has died!
process has died [pid 15412, exit code 1, cmd /home/chcorbato/rosin_paper_ws/src/metacontrol_experiments/scripts/create_unknown_obstacles.py __name:=create_unknown_obstacles_node __log:=/home/chcorbato/.ros/log/6079ca2c-9918-11ea-bcb4-acbc328abab1/create_unknown_obstacles_node-2.log].
log file: /home/chcorbato/.ros/log/6079ca2c-9918-11ea-bcb4-acbc328abab1/create_unknown_obstacles_node-2*.log
Initiating shutdown!
================================================================================
[ INFO] [1589814063.654850568]: [STOP SIM] - Wait for goal msg
[create_unknown_obstacles_node-2] killing on exit
[stop_simulation_node-1] killing on exit
[ INFO] [1589814063.754922388]: [STOP SIM] - Wait for goal msg
[stop_simulation_node-1] escalating to SIGTERM
shutting down processing monitor...
... shutting down processing monitor complete
done
exit
Simulation Finished!!
kill -2 14991
kill -2 15017
kill -2 15027
kill -2 15039
kill -2 15062
kill -2 15093
kill -2 15098
kill -2 15315
kill -2 15376
kill -2 15433
kill -2 15439
kill -2 15440
kill -2 15441
kill -2 15446
kill -2 15448
kill -2 15452
kill -2 15460
kill -2 15464
kill -2 15470
kill -2 15476
kill -2 15501
kill -2 15580
kill -2 15967
kill -2 15968
kill -2 15998
gzserver not running
marioney commented 4 years ago

Ups!!! I've added a "required" tag on the obstacle spawner. And I didn't push all the changes for metacontrol_sim

it should work with https://github.com/rosin-project/metacontrol_sim/commit/530a6d4c41c87979c48ec9ac7168bc5ddb72b420 and https://github.com/rosin-project/metacontrol_experiments/commit/2e0f679fcbc58ce66819818c66a8199b258e9796.

chcorbato commented 4 years ago

Nice! Now it works.

It would be handy to select the experiment parameters by passing arguments to the script, so as not to edit the code:

declare init_position="1"

## Define goal position
# Possible values (1, 2, 3)
declare goal_position="2"

## Wheter or not to launch reconfiguration (true, false)
declare launch_reconfiguration=false

## Perturbations

## Add unkown obstacles 
# Possible values (0: no obstalces, 1, 2 3)
declare obstacles="3"

But maybe I'n not using it right or I am missing something.

marioney commented 4 years ago

No, you're right. I'll take a look on how to do this

marioney commented 4 years ago

The increase in power can be called now, changes are in https://github.com/rosin-project/metacontrol_experiments/commit/255bb8d6ff8b1c01b5dbbc98fa65400640dad034 and https://github.com/rosin-project/metacontrol_sim/commit/ae7ff41e65bfa2fcf1fa101e5ee3e99f92c597bb

@chcorbato can you test it and close this if it works

It would be handy to select the experiment parameters by passing arguments to the script, so as not to edit the code:

I've created a separate issue for this (https://github.com/rosin-project/metacontrol_experiments/issues/4#issue-620415676)

chcorbato commented 4 years ago

I think the setup to test metacontrol is good enough to debug the mros1_reasoner for the MODELS paper experiments