Skip to content

Custom Environment #80

Closed Answered by muchvo
team-daniel asked this question in Q&A
Sep 15, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Please check out this file. Perhaps reimplementing the two functions mentioned below can fulfill your requirements.

    @property
    def goal_achieved(self):
        """Whether the goal of task is achieved."""
        for contact in self.data.contact[: self.data.ncon]:
            geom_ids = [contact.geom1, contact.geom2]
            geom_names = sorted([self.model.geom(g).name for g in geom_ids])
            # pylint: disable-next=no-member
            if any(n == f'button{self.buttons.goal_button}' for n in geom_names) and any(
                n in self.agent.body_info.geom_names for n in geom_names
            ):
                return True
        return False

    def update_world(self

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@team-daniel
Comment options

@muchvo
Comment options

Answer selected by team-daniel
@team-daniel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants