Decision Module  1.0
ICRA2020 AI Challenge Northwestern Polytechnical University Aoxiang Team Strategy Code
robot_gazebo_env.RobotGazeboEnv Class Reference
Inheritance diagram for robot_gazebo_env.RobotGazeboEnv:
firefly_env.FireflyEnv

Public Member Functions

def __init__ (self, robot_name_space, controllers_list, reset_controls, start_init_physics_parameters=True, reset_world_or_sim="SIMULATION")
 
def seed (self, seed=None)
 
def step (self, action)
 
def reset (self)
 
def close (self)
 

Public Attributes

 gazebo
 
 controllers_object
 
 reset_controls
 
 episode_num
 
 cumulated_episode_reward
 
 reward_pub
 

Private Member Functions

def _update_episode (self)
 
def _publish_reward_topic (self, reward, episode_number=1)
 
def _reset_sim (self)
 
def _set_init_pose (self)
 
def _check_all_systems_ready (self)
 
def _get_obs (self)
 
def _init_env_variables (self)
 
def _set_action (self, action)
 
def _is_done (self, observations)
 
def _compute_reward (self, observations, done)
 
def _env_setup (self, initial_qpos)
 

Constructor & Destructor Documentation

◆ __init__()

def robot_gazebo_env.RobotGazeboEnv.__init__ (   self,
  robot_name_space,
  controllers_list,
  reset_controls,
  start_init_physics_parameters = True,
  reset_world_or_sim = "SIMULATION" 
)

Member Function Documentation

◆ _check_all_systems_ready()

def robot_gazebo_env.RobotGazeboEnv._check_all_systems_ready (   self)
private
Checks that all the sensors, publishers and other simulation systems are
operational.

Reimplemented in firefly_env.FireflyEnv.

◆ _compute_reward()

def robot_gazebo_env.RobotGazeboEnv._compute_reward (   self,
  observations,
  done 
)
private
Calculates the reward to give based on the observations given.

◆ _env_setup()

def robot_gazebo_env.RobotGazeboEnv._env_setup (   self,
  initial_qpos 
)
private
Initial configuration of the environment. Can be used to configure initial state
and extract information from the simulation.

Reimplemented in firefly_env.FireflyEnv.

◆ _get_obs()

def robot_gazebo_env.RobotGazeboEnv._get_obs (   self)
private
Returns the observation.

Reimplemented in firefly_env.FireflyEnv.

◆ _init_env_variables()

def robot_gazebo_env.RobotGazeboEnv._init_env_variables (   self)
private
Inits variables needed to be initialised each time we reset at the start
of an episode.

Reimplemented in firefly_env.FireflyEnv.

◆ _is_done()

def robot_gazebo_env.RobotGazeboEnv._is_done (   self,
  observations 
)
private
Indicates whether or not the episode is done ( the robot has fallen for example).

Reimplemented in firefly_env.FireflyEnv.

◆ _publish_reward_topic()

def robot_gazebo_env.RobotGazeboEnv._publish_reward_topic (   self,
  reward,
  episode_number = 1 
)
private
This function publishes the given reward in the reward topic for
easy access from ROS infrastructure.
:param reward:
:param episode_number:
:return:

◆ _reset_sim()

def robot_gazebo_env.RobotGazeboEnv._reset_sim (   self)
private
Resets a simulation

◆ _set_action()

def robot_gazebo_env.RobotGazeboEnv._set_action (   self,
  action 
)
private
Applies the given action to the simulation.

Reimplemented in firefly_env.FireflyEnv.

◆ _set_init_pose()

def robot_gazebo_env.RobotGazeboEnv._set_init_pose (   self)
private
Sets the Robot in its init pose

Reimplemented in firefly_env.FireflyEnv.

◆ _update_episode()

def robot_gazebo_env.RobotGazeboEnv._update_episode (   self)
private
Publishes the cumulated reward of the episode and
increases the episode number by one.
:return:

◆ close()

def robot_gazebo_env.RobotGazeboEnv.close (   self)
Function executed when closing the environment.
Use it for closing GUIS and other systems that need closing.
:return:

◆ reset()

def robot_gazebo_env.RobotGazeboEnv.reset (   self)

◆ seed()

def robot_gazebo_env.RobotGazeboEnv.seed (   self,
  seed = None 
)

◆ step()

def robot_gazebo_env.RobotGazeboEnv.step (   self,
  action 
)
Function executed each time step.
Here we get the action execute it in a time step and retrieve the
observations generated by that action.
:param action:
:return: obs, reward, done, info
Here we should convert the action num to movement action, execute the action in the
simulation and get the observations result of performing that action.

Member Data Documentation

◆ controllers_object

robot_gazebo_env.RobotGazeboEnv.controllers_object

◆ cumulated_episode_reward

robot_gazebo_env.RobotGazeboEnv.cumulated_episode_reward

◆ episode_num

robot_gazebo_env.RobotGazeboEnv.episode_num

◆ gazebo

robot_gazebo_env.RobotGazeboEnv.gazebo

◆ reset_controls

robot_gazebo_env.RobotGazeboEnv.reset_controls

◆ reward_pub

robot_gazebo_env.RobotGazeboEnv.reward_pub

The documentation for this class was generated from the following file: