in robot_ws/src/rl_agent/markov/environments/meiro_runner_env.py [0:0]
def turtlebot3_reset(self):
rospy.wait_for_service('gazebo/set_model_state')
self.x = INITIAL_POS_X
self.y = INITIAL_POS_Y
self.footsteps_marker = np.zeros((int((STAGE_X_MAX - STAGE_X_MIN) / FOOTSTEPS_MARKER_SIZE)+1, int((STAGE_Y_MAX - STAGE_Y_MIN) / FOOTSTEPS_MARKER_SIZE)+1))
# Put the turtlebot at the initial position
modelState = ModelState()
modelState.pose.position.z = 0
modelState.pose.orientation.x = 0
modelState.pose.orientation.y = 0
modelState.pose.orientation.z = 0
modelState.pose.orientation.w = 0
modelState.twist.linear.x = 0
modelState.twist.linear.y = 0
modelState.twist.linear.z = 0
modelState.twist.angular.x = 0
modelState.twist.angular.y = 0
modelState.twist.angular.z = 0
modelState.model_name = 'turtlebot3_burger'
modelState.pose.position.x = self.x
modelState.pose.position.y = self.y
self.gazebo_model_state_service(modelState)
self.last_min_distance = sys.maxsize
self.last_position_x = self.x
self.last_position_y = self.y
self.last_footsteps_mark_position = self.calc_footsteps_mark_position(self.x, self.y)
time.sleep(SLEEP_AFTER_RESET_TIME_IN_SECOND)