TCPROS client implementation
Hi all!
Following my previous opened thread,
http://answers.ros.org/question/43810/about-tcp-protocol-implementation/
Instalation:
Ubuntu lucid 32bits
ROS Fuerte
Pharo 1.4 / CogVM version 'CoInterpreter VMMaker-oscog-IgorStasenko.162 uuid: e4554f9a-cc90-4826-a807-ac282b782fe4 Aug 13 2012, StackToRegisterMappingCogit VMMaker-oscog-IgorStasenko.162 uuid: e4554f9a-cc90-4826-a807-ac282b782fe4 Aug 13 2012, https://git.gitorious.org/cogvm/blessed.git Commit: aeb0705cde4b8fc57cb262dc051c5ee6dfa72a14 Date: 2012-07-26 16:38:48 +0200 By: Igor Stasenko siguctua@gmail.com'
I implemented all the Slave API, and finally i have an opened channel with the turtle.
Since beginning to this point i have manage:
PharoNode >> Master: registerPublisher '/turtle1/command_velocity'
Master: >> PharoNode here is the IP:PORT of XMLRPC of the intereseted in this topic
Turtle >> PharoNode: Protocol?
PharoNode >> Turtle: TCPROS IP:PORT
RosTopic-Echo >> PharoNode: Protocol?
PharoNode >> RosTopic-Echo: TCPROS IP:PORT
Turtle >> connectTo:IP:Port. Send connection message. Just a Connection header without data.
RosTopic-Echo >> connectTo:IP:Port. Send connection message. Just a Connection header without data.
PharoNode >> Turtle: send back a connection message, asking for a movement.
PharoNode >> RosTopic-Echo: send back a connection message, asking for a movement.
In both last responses the message is the same:
|header|
callerId:'anArbitraryId';
md5Sum:'9d5c2dcd348ac8f76ce2a4307bd63a13';
type: 'turtlesim/Velocity';
latching: true.
| body |
linear: 2.0 angular: 0.0
After this, the turtle move 2.0 to the right and the rostopic-echo just print linear: 2.0 angular: 0.0
At this point the rxgraph shows me something like:
(/anArbitraryId)---> [ /velocity ] --->( /turtlesim ) --> [/rosOut|/turtle1/color_sensor|/turtle1/pose]
But then, if i send an other message to the turtle-related socket or to the rostopic-echo related socket, nothing happens. nothing at all.
I looked at the documentation, but it dont say a lot about implementation.
Then i browsed ROS implementation, starting from teleop_turtle_key.cpp and reaching tcp_transport.cpp, and as far as i understood about the code related to TCPROS transport, it dont look to do nothing weird, just send the bytes of the message (in the case of turtle/Velocity, it may send two float32)
The messages i tried to send at this point are the follow
linear: 2.0 angular: 0.0
NOTE: this means just the 8 bytes related to the message.
EDIT:
the dump of the byte array im tryinto send to the turtle in this case is
#[0 0 0 64 0 0 0 0] in hex '[0000004000000000]'
0000000000000000000000000000000000000
Note: this means a block of 0s or 2s, just to force a log or something, but without success :(
I tried to implement some of the subscriber logic, and use the /turtle1/pose topic
trying to understand (by hand) the shape of the stream i realized that there are a word that doesnt match with the type format:
expecting these values (in this order) 4.72179222107 #[236 24 151 64]
7.13545799255 #[172 85 228 64].
4.0640001297 #[74 12 130 64].
0.0 #[0 0 0 0].
0.0 #[0 0 0 0].
i received the following bytes (as part of a longer stream)
228 64 74 12 130 64 0 0 0 0 0 0 0 0 20 0 ...