| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SegCamBehavior Class Reference#include <SegCamBehavior.h>
Inheritance diagram for SegCamBehavior: ![]() Detailed DescriptionForwards segmented images from camera over wireless.The format used for serialization is basically defined by the subclass of FilterBankGenerator being used. I suggest looking at that classes's documentation to determine the format used. (Generally either SegmentedColorGenerator or RLEGenerator) However, SegCamBehavior will add a few fields at the beginning of each packet to assist in processing the image stream. I emphasize: beginning of each Vision packet, before the FilterBankGenerator header.
Alternatively, SegCamBehavior may send a "Close Connection" packet when the server is shutting down. This is to help UDP connections, which otherwise wouldn't realize that they need to start trying to reconnect.
This is exactly the same protocol that is followed by the RawCamBehavior as well - the same code can parse either stream. However, one odd bit - since the RLEGenerator doesn't save the color information itself, SegCamBehavior will do it instead. So, if SegCamBehavior is using RLE compression, it will tack a footer at the end of the packet: (from SegmentedColorGenerator::encodeColors())
You can tell whether to expect the color footer by the creator string that follows the SegCamBehavior header. (The compression field listed is considering segmented color itself a type of compression, whether or not it's RLE encoded, so you can't use that to tell whether the data is RLE encoded until you get to the data section.) This is a binary protocol -- the fields listed indicate binary values in the AIBO's byte order (little endian). Strings are encoded using the LoadSave::encode(char*,unsigned int, unsigned int) method.
Definition at line 58 of file SegCamBehavior.h.
Member Function Documentation
Gives a short description of what this class of behaviors does... you should override this (but don't have to). If you do override this, also consider overriding getDescription() to return it Reimplemented from CameraStreamBehavior. Definition at line 75 of file SegCamBehavior.h. Referenced by getDescription().
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis). By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!) This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so. Reimplemented from CameraStreamBehavior. Definition at line 80 of file SegCamBehavior.h.
opens a new packet, writes header info; returns true if open, false if otherwise open (check cur==NULL for error) see the class documentation for SegCamBehavior for the protocol documentation Definition at line 123 of file SegCamBehavior.cc. Referenced by writeRLE(), and writeSeg().
Member Data Documentation
global instance of SegCamBehavior acting as server Definition at line 83 of file SegCamBehavior.h. Referenced by networkCallback(), SegCamBehavior(), and ~SegCamBehavior().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Fri May 11 20:08:43 2007 by Doxygen 1.4.7 |