Setup Local environement for OpenAI with ROS Course

Hi,

I’m going through OpenAI with ROS course. I would like to setup the env on my local Ubuntu 18.04 machine. I did pretty much everything and able to run gazibo, OpenAI Gym with ROS Melodic Version.

But, When I try to train the first RL training by running below command,
roslaunch my_cartpole_training start_training.launch

There is no Gazebo GUI neither no log after PID execution,

PARAMETERS
 * /cartpole_v0/alpha: 0.5
 * /cartpole_v0/control_type: velocity
 * /cartpole_v0/epsilon: 0.1
 * /cartpole_v0/epsilon_discount: 0.999
 * /cartpole_v0/gamma: 0.9
 * /cartpole_v0/init_pos: 0.0
 * /cartpole_v0/max_base_pose_x: 2.5
 * /cartpole_v0/max_base_velocity: 50
 * /cartpole_v0/max_pole_angle: 0.7
 * /cartpole_v0/min_base_pose_x: -2.5
 * /cartpole_v0/min_pole_angle: -0.7
 * /cartpole_v0/n_actions: 4
 * /cartpole_v0/nepisodes: 1000
 * /cartpole_v0/nsteps: 1000
 * /cartpole_v0/number_splits: 10
 * /cartpole_v0/pos_step: 0.016
 * /cartpole_v0/running_step: 0.04
 * /cartpole_v0/wait_time: 0.1
 * /rosdistro: melodic
 * /rosversion: 1.14.10

NODES
  /
    cartpole_gym (my_cartpole_training/start_training.py)

auto-starting new master
process[master]: started with pid [24881]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 7fefc694-2a50-11eb-acff-342eb74c7dc2
process[rosout-1]: started with pid [24892]
started core service [/rosout]
process[cartpole_gym-2]: started with pid [24895]

The same thing I tried to simulate on the ROS Studio workspace and it worked. Can some one help me on that.

Thanks,
Jegathesan S

Hi,

So by default a lot of our simulations are set to NO GUI for perfromance reasons.
You just have to go to the launch of the world in the simulation launch and set gui=true.

Hope it helps

Hi @duckfrost,

Could you please explain mean in details? Do I have to create a world file and set it to GUI?

The first exercise of OpenAI with ROS course is my_cartpole_training, and it has Launch, config and src. Which file I have to modify to get the Gazebo UI working.

Hi,

Yes so have a look at ths simulation of the curiosity rover, which is quite standard and very clear in the arguments: Curiosity_WORLD_launch

Here we set:

<arg name="gui" default="true"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
	<arg name="gui" value="$(arg gui)" />

So you have to do the same thing in the launch of the world of the cartpole:

CARTPOLE_WORLD_LAUNCH

And that’s it. Hope it helps. If you have more issues please don’t hesitate to poste here , create a rosject and so on, it would help a ton!