Exchange of messages between agents
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
|
Help
]
Start:
Up:[[Tutorial]] Previous:[[Humanoid agent operat...
----
#contents
* Exchange of messages between agents. [#ia7882aa]
※This tutorial is valid only for later than v2.1.0.
** Sending and receiving messages [#d353e783]
*** Controller of message sender [#zd064119]
Create a controller for sending messages.
$ cd ~/MyWorld
$ emacs SendController.cpp
#gist(sigverse-git/4ec290ead83ed03833efd8cd5791531f);
This controller send a message "Hello!" to the robot agen...
If you want to send a message to all of the agents in the...
Old
#highlight(cpp:firstline[38]){{
sendMsg("robot_000",msg);
}}
New
#highlight(cpp:firstline[38]){{
broadcastMsg(msg);
}}
*** Controller to receive messages [#i2790ab2]
Create a controller to receive messages.
$ emacs RecvController.cpp
#gist(sigverse-git/dfd3d5c6d9d64180ca9eb8ffba54d544);
This controller put the agent's hand up if a message "Hel...
The agent will put the hand down every 0.5 second.
Compiling the controller.
$ ./sigmake.sh SendController.cpp RecvController.cpp
*** Creating a worldfile [#w395fedb]
$ emacs MessageWorld.xml
#gist(sigverse-git/008dee0218d42c41388f7e02a2fe09c5);
In this controller, a human avator will send a message to...
*** Execution [#tb38ac14]
$ sigserver.sh -w ./MessageWorld.xml
First, the avatar agent put a hand down and turn back by ...
Then, you can see that the agent put it's hand up every s...
#ref(./message_1.PNG,40%)
** Specification of message reachable area [#a22b41bf]
This part explains how to specify the maximum length of t...
*** Controller of text message sender [#we283cc2]
Create another controller to send messages.
$ emacs SendController2.cpp
SendController2.cpp
#gist(sigverse-git/8a057f168978dd46bb2c48ae5c912a11);
The second argument of the broadcastMsg, 300, means that ...
If you omit the secnod argument, the message will be reac...
This agent keeps on sending a message and moving to z-axis.
*** Compiling [#k7a9b5fc]
$ ./sigmake.sh SendController2.cpp
*** Modification of the world file [#s62dc619]
$ emacs MessageWorld.xml
Modify the MessageWorld.xml to change the controller for ...
Old
#highlight(xml:firstline[13]){{
<set-attr-value name="implementation" value="./Sen...
}}
New
#highlight(xml:firstline[13]){{
<set-attr-value name="implementation" value="./Sen...
}}
*** Execution [#m24d78ab]
$ sigserver.sh -w ./MessageWorld.xml
#ref(./message_3.PNG,40%)
You can see the agent sending messages with backing away ...
Please check how far the message reaches to the receiver.
** Sending message to the SIGViewer [#sa02f588]
If the broadcastMsg is used, the message will be reached ...
The SIGViewer will show the received message as log messa...
You can send messages to the SIGViewer using sendMsg.
In this case, you should specify a service name which is ...
If the service name is "SIGViewer", the following modific...
SendController.so
Old
#highlight(cpp:firstline[33]){{
sendMsg("robot_000",msg);
}}
New
#highlight(cpp:firstline[33]){{
sendMsg("SIGViewer",msg);
}}
#highlight(end)
Up:[[Tutorial]] Previous:[[Humanoid agent operat...
#counter
End:
Up:[[Tutorial]] Previous:[[Humanoid agent operat...
----
#contents
* Exchange of messages between agents. [#ia7882aa]
※This tutorial is valid only for later than v2.1.0.
** Sending and receiving messages [#d353e783]
*** Controller of message sender [#zd064119]
Create a controller for sending messages.
$ cd ~/MyWorld
$ emacs SendController.cpp
#gist(sigverse-git/4ec290ead83ed03833efd8cd5791531f);
This controller send a message "Hello!" to the robot agen...
If you want to send a message to all of the agents in the...
Old
#highlight(cpp:firstline[38]){{
sendMsg("robot_000",msg);
}}
New
#highlight(cpp:firstline[38]){{
broadcastMsg(msg);
}}
*** Controller to receive messages [#i2790ab2]
Create a controller to receive messages.
$ emacs RecvController.cpp
#gist(sigverse-git/dfd3d5c6d9d64180ca9eb8ffba54d544);
This controller put the agent's hand up if a message "Hel...
The agent will put the hand down every 0.5 second.
Compiling the controller.
$ ./sigmake.sh SendController.cpp RecvController.cpp
*** Creating a worldfile [#w395fedb]
$ emacs MessageWorld.xml
#gist(sigverse-git/008dee0218d42c41388f7e02a2fe09c5);
In this controller, a human avator will send a message to...
*** Execution [#tb38ac14]
$ sigserver.sh -w ./MessageWorld.xml
First, the avatar agent put a hand down and turn back by ...
Then, you can see that the agent put it's hand up every s...
#ref(./message_1.PNG,40%)
** Specification of message reachable area [#a22b41bf]
This part explains how to specify the maximum length of t...
*** Controller of text message sender [#we283cc2]
Create another controller to send messages.
$ emacs SendController2.cpp
SendController2.cpp
#gist(sigverse-git/8a057f168978dd46bb2c48ae5c912a11);
The second argument of the broadcastMsg, 300, means that ...
If you omit the secnod argument, the message will be reac...
This agent keeps on sending a message and moving to z-axis.
*** Compiling [#k7a9b5fc]
$ ./sigmake.sh SendController2.cpp
*** Modification of the world file [#s62dc619]
$ emacs MessageWorld.xml
Modify the MessageWorld.xml to change the controller for ...
Old
#highlight(xml:firstline[13]){{
<set-attr-value name="implementation" value="./Sen...
}}
New
#highlight(xml:firstline[13]){{
<set-attr-value name="implementation" value="./Sen...
}}
*** Execution [#m24d78ab]
$ sigserver.sh -w ./MessageWorld.xml
#ref(./message_3.PNG,40%)
You can see the agent sending messages with backing away ...
Please check how far the message reaches to the receiver.
** Sending message to the SIGViewer [#sa02f588]
If the broadcastMsg is used, the message will be reached ...
The SIGViewer will show the received message as log messa...
You can send messages to the SIGViewer using sendMsg.
In this case, you should specify a service name which is ...
If the service name is "SIGViewer", the following modific...
SendController.so
Old
#highlight(cpp:firstline[33]){{
sendMsg("robot_000",msg);
}}
New
#highlight(cpp:firstline[33]){{
sendMsg("SIGViewer",msg);
}}
#highlight(end)
Up:[[Tutorial]] Previous:[[Humanoid agent operat...
#counter
Page: