Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python communication agent is broken #53

Closed
DurgeshSamant opened this issue Oct 27, 2017 · 6 comments
Closed

Python communication agent is broken #53

DurgeshSamant opened this issue Oct 27, 2017 · 6 comments

Comments

@DurgeshSamant
Copy link
Contributor

DurgeshSamant commented Oct 27, 2017

Upon attempting to run it, one gets error message of the form
base_left 7: [4778, 0] recv error message [(error illegal_command_form)]
base_left 7: [4778, 0] lost say? at [4778, 0] sense=0 internal=1

Quite strangely the above error disappears if in hfo/hfo_c_wrapper.h, instead of
hfo.say(message)
one uses hfo.say("anyfixedstring")
One can then hear() back "anyfixedstring". Alas this is of no use - what one wishes is to be able to send custom messages through the python communication agent. Playing around with const char* message with different datatype + variable combination did not get me anywhere.

Further examination reveals that the 'say_msg' in /src/agent.h:setSayMsg() does seem to be set correctly. So the sending code seems to be correct (atleast till that point).

In an attempt to locate the function that prints the obtained error message, I looked at analyzeError() functions in
./build/librcsc-prefix/src/librcsc/rcsc/coach/coach_agent.cpp
./build/librcsc-prefix/src/librcsc/rcsc/player/player_agent.cpp
./build/librcsc-prefix/src/librcsc/rcsc/trainer/trainer_agent.cpp
However, none of these seem to be throwing the error.

Any help from someone more knowledgeable about the internals would be greatly appreciated.

@drallensmith
Copy link
Contributor

drallensmith commented Oct 30, 2017 via email

@drallensmith
Copy link
Contributor

drallensmith commented Oct 30, 2017 via email

@drallensmith
Copy link
Contributor

drallensmith commented Oct 30, 2017 via email

@DurgeshSamant
Copy link
Contributor Author

DurgeshSamant commented Oct 30, 2017

Hi Allen,

Thanks for the reply.

In hfo/hfo_c_wrapper.h, instead of
hfo.say(message)
if one uses hfo.say("a b")
One can then hear() back "a b". So a message containing a space separated string works well as long as it is hard-coded into the wrapper.

I am using python3.4 on Ubuntu 14.04.5 LTS.

@DurgeshSamant
Copy link
Contributor Author

In HFO/build/rcssserver-prefix/src/rcssserver/src/player.cpp, I tried to insert prints in the parseMsg() and parseCommand(). However, they did not show up on the output or in the logs. So I'm not sure if I'm doing it right.

@DurgeshSamant
Copy link
Contributor Author

It turns out that the issue was rather benign. The default message string "Hello!" had the special charachter '!'. Removing it, makes everything work smoothly. Here is an additional list of what the message string can and cannot contain
# the message string can contain charachters a-z A-Z 0-9
# the message string can contain special charachters like ?SPACE-*()+_<>/
# the message string cannot contain !@#$^&={}[];:"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants