Skip to content

Gremlin movement #85

Closed Answered by muchvo
team-daniel asked this question in Q&A
Discussion options

You must be logged in to vote

Please refer to this file and reimplement these functions.

    def move(self):
        """Set mocap object positions before a physics step is executed."""
        phase = float(self.engine.data.time)
        for i in range(self.num):
            name = f'gremlin{i}'
            target = np.array([np.sin(phase), np.cos(phase)]) * self.travel
            pos = np.r_[target, [self.size]]
            self.set_mocap_pos(name + 'mocap', pos)

    def get_obj(self, xy_pos, rot):
        """To facilitate get objects config for this object"""
        body = {
            'name': self.name,
            'pos': np.r_[xy_pos, self.size],
            'rot': rot,
            'geoms': [
                {…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by team-daniel
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