|
MIRA
|
This package provides (Micro)units that subscribe to a map channel and republish a certain region of the map to another channel. Different unit types are implemented each for a specific map type, at the moment these are OccupancyGrid (static and dynamic occupancy maps), GridMap<double, 1> (CostMapper maps), GridMap<uint8, 3> (NavStatus published by Pilot). This is done via a templated implementation and specializations for the mentioned types.
The purpose of selecting and publishing a region of the map separately is to save network bandwidth when viewing a map from a remote framework. With large maps at high update rates (e.g. CostMapper costmap), subscribing to the original map can be very demanding on network bandwidth. Even though the user may only be interested in the region around the robot, the entire channel content (map) must be transferred with each update. By publishing a cropped map region (in the remote framework!), only a fraction of the data must be transferred to view the region of interest.
How to instantiate it:
Of course it is possible to include MapCropper(s) with the original application configuration. However, since its purpose is to make remote monitoring more efficient, it will not always be clear beforehand for which channels it will be required, and it does not make much sense to include a MapCropper for any channel it might support (i.e., that just has the right type). Instead, MapCropper is meant to be instantiated by the (remotely connected) user on demand.
Obviously, the MapCropper must run in the original framework with the map to be cropped, not in a remote framework. This can be achieved by loading a MapCropper configuration into the original framework using the framework's 'loadConfig' RPC method.
| Do NOT: miracenter MapCropper.xml -k <ip:port> Do: mirainspect rpc call <RemoteFrameworkID>.loadConfig("<map cropper config>") -k <ip:port> Do better: miracenter -k <ip:port> |
There are 3 specific units, named OccupancyGridCropper, CostMapCropper, NavStatusCropper. Each of them can crop one specific map type.
The MapType for the channels below depends on the individual unit:
CropFrame
The frame that determines the position of the cropped region on the original map. The unit can use an arbitrary transformation frame for CropFrame by means of a using directive. A transformation must exist between CropFrame and Map's frame (otherwise the unit will fail to start).
By choosing a moving frame like /robot/Robot/, the cropped region can be made to move with the robot. Alternatively, a static frame like /maps/MapFrame can be used, and the region can then be selected manually through the unit's Position properties. Of course, combination of moving with a frame and manually manipulating the offset is possible.
1.8.14