openai_ros.task_envs.husarion package


openai_ros.task_envs.husarion.husarion_get_to_position_turtlebot_playground module

class openai_ros.task_envs.husarion.husarion_get_to_position_turtlebot_playground.HusarionGetToPosTurtleBotPlayGroundEnv[source]

Bases: openai_ros.robot_envs.husarion_env.HusarionEnv


This Task Env is designed for having the husarion in the husarion world closed room with columns. It will learn how to move around without crashing.

__module__ = 'openai_ros.task_envs.husarion.husarion_get_to_position_turtlebot_playground'
_compute_reward(observations, done)[source]

We will reward the following behaviours: 1) The distance to the desired point has increase from last step 2) The robot has reached the desired point

We will penalise the following behaviours: 1) Ending the episode without reaching the desired pos. That means it has crashed or it has gone outside the workspace


Here we define what sensor data defines our robots observations To know which Variables we have acces to, we need to read the HusarionEnv API DOCS :return:


Inits variables needed to be initialised each time we reset at the start of an episode. :return:


We consider that the episode has finished when: 1) Husarion has moved ouside the workspace defined. 2) Husarion is too close to an object 3) Husarion has reached the desired position


This set action will Set the linear and angular speed of the SumitXl based on the action number given. :param action: The action integer that set s what movement to do next.


Sets the Robot in its init pose


Based on the laser readings we check if any laser readingdistance is below the minimum distance acceptable.


We check that the current position is inside the given workspace.

check_reached_desired_position(current_position, desired_position, epsilon=0.1)[source]

It return True if the current position is similar to the desired poistion

discretize_scan_observation(data, new_ranges)[source]

Discards all the laser readings that are not multiple in index of new_ranges value.

get_distance_from_desired_point(current_position, desired_position)[source]

Calculates the distance from the current position to the desired point :param current_position: :param desired_position: :return:

get_distance_from_point(pstart, p_end)[source]

Given a Vector3 Object, get distance from current position :param p_end: :return:

publish_filtered_laser_scan(laser_original_data, new_filtered_laser_range)[source]

With this method you can change the desired position that you want Usarion to be that initialy is set through rosparams loaded through a yaml file possibly. :new_position: Type Point, because we only value the position.

Module contents