From: Jan M. <mu...@un...> - 2006-07-28 09:16:23
|
Hi, One organizational issue first. You should send questions about the 3D server to sserver-3D list (sse...@li...), not to rob...@cc.... I'll include sserver-three-d in the CC: Now about your problem: |<yy...@so...> said: > I have tried "(kickoff)" instead of "(kickOff)", I have also modified > my codes according the codes provied, but it seems still doesn't > work. Before start the match, I send "W(kickoff)" or "W(kickOff)",but > the match still doesn't start. When I send "W(playMode > corner_kick_right)" before kick off, the server seems to work as it > displays "corner_kick_right" on top of the monitor. But when the match > starts, I send "W(playMode corner_kick_right)" again it doesn't work > at all. I also tried to send "W(agent (team L) (unum 2) (pos > 1.0,2.0,0.3) (vel 0.0 0.0 0.0))", but the monitor displays "Cann't get > agent pos",I really don't know why, I listed my source codes > below. Looking forward to your help. Which version of rcssserver3D are you using? From version 0.5 the syntax of the kickoff command changed. You have to send (kickOff <side>) where side is one of Left, Right or None. You also found some bugs in the TEXT_INSTEAD_OF_A_MANUAL.txt. Congratulations! ;-) 1. coordinates are ALWAYS separated by space, not comma. E.g. the right command for setting the ball position to 5m above the center point is (ball (pos 0.0 0.0 5.0)), NOT (ball (pos 0.0,0.0,5.0)). This is wrong in the manual. The same applies to setting agent positions and velocities. 2. When you move an agent, you have to use (team Left) or (team Right) in the command, not (team L|R). This is explained correctly in the manual, but wrong in the example. Sending "W(agent (team Left)(unum 2)(pos 1.0 2.0 0.3)(vel 0.0 0.0 0.0))" should work. There may also be some unwanted interactions with the simulator, if you send a command at the wrong time. An example may help to clarify this. In BeforeKickOff mode the simulator takes care that the ball is in the center of the field. If you change the ball position in this play mode, the simulator will immediately place the ball in the center again, so it looks as if nothing had happend. When you try to move an agent in BeforeKickOff mode something similar may happen. Most teams use a variant of this for lining up: while (playmode == BeforeKickOff) { if (myPos != myHomePos) beamto(myHomePos); } If you try to move such an agent, it just uses its beam effector to move back. Sometimes you can see the agent flickering in the monitor. This means that the monitor displays the *new* position for one cycle, before the agent sends the beam command. So, if a command does not work, try sending it during another play mode, to see if it fails because of some internal interactions. These corrections should work: > //const char* command ="W(ball (pos 10,20,0.11))"; const char* command ="W(ball (pos 10 20 0.11))"; > //const char* command = "W(kickoff)"; const char* command = "W(kickoff None)"; // random kick off > const char* command = "W(agent (team L) (unum 2) (pos 1.0,2.0,0.3) (vel 0.0 0.0 0.0))"; const char* command = "W(agent (team Left)(unum 2)(pos 1.0 2.0 0.3)(vel 0.0 0.0 0.0))"; [...] HTH & HAND, Jan -- Jan Murray + Uni Koblenz + http://www.uni-koblenz.de/~murray/contact.html ________________________________________________________ \"Trusting every aspect of our lives to a giant computer \ was the smartest thing we ever did!" -- Homer Simpson |