From: brian g. <bg...@us...> - 2003-02-05 03:00:20
|
Hi everybody, I've just checked in a slew of changes to Player (and a few changes to Stage), in order to get all robot control on one TCP port. To recap, Player now listens on just one port, even when running in Stage. Each device is identified by the triple: {robot,interface,index}. Thus, with one TCP connection, you can control multiple devices on multiple robots, treating them (if you wish) as one large sensor-actuator network. This change might also prove beneficial with physical robots when combined with the passthrough driver: you can use an auxillary Player server, full of passthrough drivers, to aggregate in one place the data and control for all the robots' devices. It's done, I've tested it a bit, and it seems to work fine. Important changes and notes are below. Let me know if you have problems. Remember that you can check out the tag 'pre-single-port' if you don't want to deal with these changes right now. brian. ------------------------------------------------------------------------------ Player ------------------------------------------------------------------------------ I ended up changing the Player message protocol in the following ways: - The message header now has a 2-byte 'robot' field that specifies to which robot the message pertains (the header is still 32 bytes; I took two bytes out of the 4-byte 'reserved' field). - The device subscription message payload now contains an extra field, to identify the robot to subscribe to. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Stage ------------------------------------------------------------------------------ I changed the semantics of the Stage .world file in the following way: - The 'port' keyword for a Player entity now sets the robot id for that entity, *not* the port. This is a temporary situation, as the whole config file setup will change substantially when Richard merges his Stage changes back into HEAD. I add a command-line argument to Stage: - To specify the single port on which Player should listen, pass '-pp <port>' to Stage. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ C++ Client library ------------------------------------------------------------------------------ I've updated the C++ client (and the underlying C client) to support the protocol changes. I've also add the ability to take advantage of the new robot id mechanism: - When creating a proxy, such as for a position device, you can select the robot id by passing it as the 4th argument to the constructor, e.g.: PositionProxy pp(&playerclient, 0, 'a', 1); If you don't pass the 4th arg, then it's assumed to be 0. I know this is not a great API; I'll polish it later. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ libplayerc ------------------------------------------------------------------------------ I've updated libplayerc to support the protocol changes, but have *not* added the ability to take advantage of the new robot id mechanism. In particular, this means that libplayerc is currently only capable of controlling the robot (if any) with id 0. playerv works, but gets a little confused by the list of available devices, whose names only differ by robot id. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Tclplayer ------------------------------------------------------------------------------ I haven't updated Tclplayer yet. ------------------------------------------------------------------------------ |