Robotics StackExchange | Archived questions

Unable to reset player position by setting playMode to BeforeKickOff via monitor message in robocup3ds

Hi, I want to control a simulated Nao in Gazebo using robocup3ds plugin. I need the ability to reset ball position and Nao position whenever I set the game play mode to Before-Kickoff. My code already works with rcssserver3d and simspark. Now I need to adapt my code to robocup3ds plugin. But in robocup3ds, setting play mode to Before-Kickoff just resets the ball position. Nao position is sometimes reset as expected, but sometimes it is not. For example suppose Nao initial position is (0, 0, 0). Assume Nao is at position (-2, 3, 0) and fallen on the ground. Now setting play mode to Before-Kickoff resets Nao position to a point near its last position (e.g. (-2.1, 3.2, 0)). But the desired behavior is to reset Nao to its initial position which is (0, 0, 0).

I have spent several days to figure out what's wrong. But I failed to do so. Does anyone know what might cause such a behavior?

Thanks in advance.

Asked by hhnavid on 2018-08-05 23:22:16 UTC

Comments

Answers

Hi, Thanks to the useful hints by Patrick McAlpine, I was able to reset Nao position correctly. I couldn't do it using beam command :

(beam x y rot).

But as Patrick pointed out, I managed to use move command instead:

(agent (unum num) (team team) (pos x y z) (move x y z rot) (battery batterylevel) (temperature temperature) )

This is a workaround for my problem but it yields the result I need.

Asked by hhnavid on 2018-12-15 00:10:56 UTC

Comments