Skip to content

point_goal_reward

PointGoalReward

Bases: BaseRewardFunction

Point goal reward Success reward for reaching the goal with the robot's base

Parameters:

Name Type Description Default
pointgoal PointGoal

Termination condition for checking whether a point goal is reached

required
r_pointgoal float

Reward for reaching the point goal

10.0
Source code in omnigibson/reward_functions/point_goal_reward.py
class PointGoalReward(BaseRewardFunction):
    """
    Point goal reward
    Success reward for reaching the goal with the robot's base

    Args:
        pointgoal (PointGoal): Termination condition for checking whether a point goal is reached
        r_pointgoal (float): Reward for reaching the point goal
    """

    def __init__(self, pointgoal, r_pointgoal=10.0):
        # Store internal vars
        self._pointgoal = pointgoal
        self._r_pointgoal = r_pointgoal

        # Run super
        super().__init__()

    def _step(self, task, env, action):
        # Reward received the pointgoal success condition is met
        reward = self._r_pointgoal if self._pointgoal.success else 0.0

        return reward, {}