Both the lcm-library as the April toolkit contain several modules to record, monitor, inspect and process the information on the lcm-channels, as for instance the LCM Spy (see Usage).
The lcm_usarsim_proxy.exe assumes that on the local machine USARSim is running. USARSim can be started by selecting one of the scripts in UDK-Release\USARRunMaps. The program lcm_usarsim_proxy.exe can be called without any arguments. In that case a number of default choices are made. The most sensitive argument is -l; the start location.
The default choice is a start position for the script Robocup2012-Tryout.bat. Possible start positions differ for every map. A list of positions can be displayed with the following command: telnet 127.0.0.1:3000 followed by command getstartposes. Note that the telnet-client is no longer a default part of Windows7, you should first activate this feature
via Control Panel->Programs and Features->Turn Windows features on or off->telnet-client.
This is the list of expected arguments:
-h 127.0.0.1 : host - ip-adress of host where USARSim is running
-t P3AT : type - the type of this robot
-n Robot1 : name - the name of this robot
-l -5.4734,27.8247,1.4720 : location - the location where the robot is spawned
-r 0.0000,0.0000,-3.4361 : rotation - the rotation of the robot when spawned
-v 1 : viewport - the tile of the robots' camera in multiview (upperleft=1,2=totheright)
-w 0 : 2nd viewport - the tile of the robots' 2nd camera in multiview (none=0,upperleft=1,2=totheright)
-x 2 : CameraTileX - the number of columns of multiview (typically 1,2,3)
When succesfully connected, the console shows the following three lines:
Connected to USARSim at machine 127.0.0.1:3000
LCM: TTL set to 1.
Connected to ImageServer at machine 127.0.0.1:5003
If you have installed the rest of the lcm-library, you can inspect the data published on the channels with the command: java -ea -server lcm.spy.Spy -l udpm://239.255.76.67:7667?ttl=1.
This illustrated in Figure 2:
Fig. 2: A screenshots of LcmSpy for a P3AT, Kenaf and AirRobot gamebot.
Dependencies
The program is made based on Microsoft's .Net Framework. It references System components from both .Net Framework v2.0 and v3.5.
If missing you can find redistributables and SDKs at Microsoft's website.
Known issues
- The program lcm_usarsim_proxy.exe is a proof of concept. It is a rapid prototype, not optimized for effiency or robustness. See the disclaimer.
- The packaging of larger messages results in a Magic Error. Seems that this is a byte-order issue (big / little endian)
inside the lcm-library. Temporary solution is to use the ImageServer with ImageType > 1. So for the moment, don't use ImageType=0 (raw) or ImageType=1 (jpeg - super quality).
- The GAMEPAD-channel is only tested with java -ea -server april.util.KeyboardGamepad.
The keystrokes are quite binary (on / off), but the gamepad_t format is contineous. Currently, the continues values are clipped again with a threshold; the robots are driven with a fixed speed.
This should be tested with a real gamepad (under Linux). Anyway, controlling with keyboard works fine.
- The LASER-channel contains no information about the type of laserscanner or the value it uses as max_range. The LaserPlugin used by the LcmSpy assumes a fixed value of 75m, which is inappropriate for the Hokuyo laserscanner mounted on the Kenaf (see Fig. 2).
- The program lcm_usarsim_proxy.exe is tested with three mobile robots used inside the RoboCup Rescue Simulation League; P3AT, Kenaf, AirRobot. The UDK-version of USARSim has currently no implementation (yet) of the interface to control the Pan-Tilt of the AirRobot and the flippers of the Kenaf.
The program is not (yet) tested for other robots, such as the robot arms (used in the Virtual Manufacturing competition) and the humanoid Nao (used in RoboCup Soccer).
- This program is made in the .Net languages C# and Visual Basic. It could also have been implemented in one of the other languages provided by the lcm: C, C++, Python, Java. The major reason that it was implemented in C# was the presence of a tested networking module which took care of the connection to USARSim.
Also the convertion of image streams is a known asset of .Net. Yet, feel free to reimplement this proxy in another language.
Documentation
Installation instructions
Download from the code to