Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

beobot-GSnav-master.C File Reference


Detailed Description

Robot navigation using a combination saliency and gist. Run beobot-GSnav-master at CPU_A to run Gist-Saliency model Run beobot-GSnav at CPU_B to run SIFT object recognition

Definition in file beobot-GSnav-master.C.

#include "Beowulf/Beowulf.H"
#include "Component/ModelManager.H"
#include "Media/FrameSeries.H"
#include "Transport/FrameIstream.H"
#include "Neuro/SaccadeController.H"
#include "Neuro/SaccadeControllers.H"
#include "Neuro/SaccadeControllerConfigurator.H"
#include "Neuro/NeuroOpts.H"
#include "Image/Image.H"
#include "Image/Pixels.H"
#include "Raster/Raster.H"
#include "GUI/XWinManaged.H"
#include "Media/MediaOpts.H"
#include "Util/Timer.H"
#include "Simulation/SimEventQueue.H"
#include "Simulation/SimEventQueueConfigurator.H"
#include "Devices/DeviceOpts.H"
#include "Beobot/BeobotBrainMT.H"
#include "Beobot/BeobotConfig.H"
#include "Beobot/BeobotControl.H"
#include "Beobot/BeobotBeoChipListener.H"
#include "RCBot/Motion/MotionEnergy.H"
#include "Controllers/PID.H"
#include "Image/MathOps.H"
#include "Image/CutPaste.H"
#include "Image/DrawOps.H"
#include "Image/FilterOps.H"
#include "Image/PyramidOps.H"
#include "Image/ShapeOps.H"
#include "Image/Transforms.H"
#include "Beobot/beobot-GSnav-def.H"
#include "Beobot/GSnavResult.H"
#include <signal.h>

Include dependency graph for beobot-GSnav-master.C:

Go to the source code of this file.

Defines

#define ERR_INTERVAL   5000

Functions

std::string getInputPrefix (nub::soft_ref< InputFrameSeries > ifs, int &inputType)
 get the input prefix to save the intermdeiate results
int getOpMode (std::string opmodestr)
 get the operation mode of the current run
void setupBeoChip (nub::soft_ref< BeoChip > b, BeobotConfig bbc)
 setup the BeoChip
int beoChipProc (rutz::shared_ptr< BeobotBeoChipListener > lis, nub::soft_ref< BeoChip > b)
 process beoChip input
void getBbmtResults (nub::ref< BeobotBrainMT > bbmt, Image< PixRGB< byte > > &currIma, Image< double > &cgist, Image< float > &currSalMap, ImageSet< float > &cmap, std::vector< Point2D< int > > &salpt, std::vector< std::vector< double > > &feat, std::vector< Rectangle > &objRect)
 get all the necessary information from the visual cortex
void dispResults (Image< PixRGB< byte > > disp, rutz::shared_ptr< XWinManaged > win, Image< PixRGB< byte > > ima, Image< PixRGB< byte > > prevIma, std::vector< Point2D< int > > clmpt, std::vector< Point2D< int > > nlmpt, Image< float > currSalMap, std::vector< Point2D< int > > salpt, std::vector< Rectangle > objRect)
 display results
bool checkNode (int opMode, nub::soft_ref< Beowulf > beo, int32 &rnode, TCPmessage &rmsg, int32 &raction, int32 &rframe)
 check to see if the node have returned results
bool checkInput (int opMode, bool resetNextLandmark, uint64 inputFrameRate, uint64 inputTime)
 check to see if the new input should be processed
void setupVentralPacket (TCPmessage &smsg, int rframe, bool resetVentralSearch, Image< PixRGB< byte > > currIma, Image< double > cgist, std::vector< Point2D< int > > salpt, std::vector< std::vector< double > > feat, std::vector< Rectangle > objRect, float dx, float dy, uint snumGT, float ltravGT)
void setupDorsalPacket (TCPmessage &smsg, int rframe, ImageSet< float > cmap, bool resetCurrLandmark, std::vector< Point2D< int > > clmpt, bool resetNextLandmark, std::vector< Point2D< int > > nlmpt)
 setup the packet containing cmaps for tracking
void processDorsalResult (TCPmessage &rmsg, int32 raction, int32 rframe, std::vector< Point2D< int > > &clmpt, std::vector< Point2D< int > > &nlmpt, bool &resetNextLandmark, float &sp, float &st)
 get the proper motor command to run the robot
void processVentralResult (TCPmessage &rmsg, int32 raction, int32 rframe, std::vector< Point2D< int > > &clmpt, std::vector< Point2D< int > > &nlmpt, bool &resetCurrLandmark, bool &resetNextLandmark)
 setup for the next search
void getOdometry (float &dx, float &dy)
 get the odometry information
void executeMotorCommand (int opMode, float st, float sp)
 execute the motor command from Dorsal
Image< double > hack (uint fNum, uint &snumGT, float &ltravGT, float &dx, float &dy)
 feed in the gist file and current ground truth
void reportResults (std::string resultPrefix, uint nsegment)
 report the results of the current run
void terminate (int s)
 Signal handler (e.g., for control-C).
int main (const int argc, const char **argv)

Variables

static bool goforever = true


Function Documentation

int beoChipProc rutz::shared_ptr< BeobotBeoChipListener lis,
nub::soft_ref< BeoChip b
 

process beoChip input

Definition at line 862 of file beobot-GSnav-master.C.

References BC_NO_SIGNAL, BC_QUIT_SIGNAL, and i.

bool checkInput int  opMode,
bool  resetNextLandmark,
uint64  inputFrameRate,
uint64  inputTime
 

check to see if the new input should be processed

Definition at line 921 of file beobot-GSnav-master.C.

References ERR_INTERVAL, TEST_MODE, and TRAIN_MODE.

Referenced by main().

bool checkNode int  opMode,
nub::soft_ref< Beowulf beo,
int32 rnode,
TCPmessage rmsg,
int32 raction,
int32 rframe
 

check to see if the node have returned results

Definition at line 911 of file beobot-GSnav-master.C.

References beo.

Referenced by main().

void dispResults Image< PixRGB< byte > >  disp,
rutz::shared_ptr< XWinManaged win,
Image< PixRGB< byte > >  ima,
Image< PixRGB< byte > >  prevIma,
std::vector< Point2D< int > >  clmpt,
std::vector< Point2D< int > >  nlmpt,
Image< float >  currSalMap,
std::vector< Point2D< int > >  salpt,
std::vector< Rectangle objRect
 

display results

Definition at line 784 of file beobot-GSnav-master.C.

References drawDisk(), drawRect(), Image< T >::getHeight(), Image< T >::getWidth(), h, i, Image< T >::initialized(), inplaceNormalize(), inplacePaste(), rutz::min(), quickInterpolate(), sformat(), Image< T >::size(), SMFAC, sml, toRGB(), w, and writeText().

Referenced by Beobot2GistSalMasterI::evolve().

void executeMotorCommand int  opMode,
float  st,
float  sp
 

execute the motor command from Dorsal

Definition at line 761 of file beobot-GSnav-master.C.

References LERROR, TEST_MODE, and TRAIN_MODE.

Referenced by main().

void getBbmtResults nub::ref< BeobotBrainMT bbmt,
Image< PixRGB< byte > > &  currIma,
Image< double > &  cgist,
Image< float > &  currSalMap,
ImageSet< float > &  cmap,
std::vector< Point2D< int > > &  salpt,
std::vector< std::vector< double > > &  feat,
std::vector< Rectangle > &  objRect
 

get all the necessary information from the visual cortex

Definition at line 882 of file beobot-GSnav-master.C.

References features, i, and NUM_CHANNELS.

Referenced by Beobot2GistSalMasterI::evolve(), and main().

std::string getInputPrefix nub::soft_ref< InputFrameSeries ifs,
int &  inputType
 

get the input prefix to save the intermdeiate results

Definition at line 639 of file beobot-GSnav-master.C.

References CAMERA_INPUT, FILE_INPUT, i, input, and LINFO.

Referenced by main().

void getOdometry float &  dx,
float &  dy
 

get the odometry information

Definition at line 754 of file beobot-GSnav-master.C.

Referenced by main().

int getOpMode std::string  opmodestr  ) 
 

get the operation mode of the current run

Definition at line 699 of file beobot-GSnav-master.C.

References TEST_MODE, and TRAIN_MODE.

Referenced by main().

Image< double > hack uint  fNum,
uint snumGT,
float &  ltravGT,
float &  dx,
float &  dy
 

feed in the gist file and current ground truth

Definition at line 1162 of file beobot-GSnav-master.C.

References Image< T >::beginw(), i, LDEBUG, LFATAL, NO_INIT, and sformat().

Referenced by main(), and Beobot2_GistSalLocalizerMasterI::updateMessage().

void processDorsalResult TCPmessage rmsg,
int32  raction,
int32  rframe,
std::vector< Point2D< int > > &  clmpt,
std::vector< Point2D< int > > &  nlmpt,
bool &  resetNextLandmark,
float &  sp,
float &  st
 

get the proper motor command to run the robot

Definition at line 1082 of file beobot-GSnav-master.C.

References Image< T >::clear(), TCPmessage::getElementInt32(), i, LDEBUG, LINFO, TCPmessage::reset(), and TRACK_LM_RES.

Referenced by main().

void processVentralResult TCPmessage rmsg,
int32  raction,
int32  rframe,
std::vector< Point2D< int > > &  clmpt,
std::vector< Point2D< int > > &  nlmpt,
bool &  resetCurrLandmark,
bool &  resetNextLandmark
 

setup for the next search

Definition at line 1026 of file beobot-GSnav-master.C.

References Image< T >::clear(), TCPmessage::getElementInt32(), TCPmessage::getSize(), i, LDEBUG, LINFO, TCPmessage::reset(), SEARCH_LM_RES, and Image< T >::size().

Referenced by main().

void reportResults std::string  resultPrefix,
uint  nsegment
 

report the results of the current run

Definition at line 1293 of file beobot-GSnav-master.C.

References LINFO, GSnav_M_Result::maxBbmtTime, GSnav_M_Result::maxDorsalTime, GSnav_M_Result::maxInputTime, GSnav_M_Result::maxVentralSearchTime, GSnav_M_Result::meanBbmtTime, GSnav_M_Result::meanDorsalTime, GSnav_M_Result::meanInputTime, GSnav_M_Result::meanVentralSearchTime, GSnav_M_Result::minBbmtTime, GSnav_M_Result::minDorsalTime, GSnav_M_Result::minInputTime, GSnav_M_Result::minVentralSearchTime, GSnav_M_Result::read(), GSnav_M_Result::stdevBbmtTime, GSnav_M_Result::stdevDorsalTime, GSnav_M_Result::stdevInputTime, and GSnav_M_Result::stdevVentralSearchTime.

Referenced by main().

void setupBeoChip nub::soft_ref< BeoChip b,
BeobotConfig  bbc
 

setup the BeoChip

Definition at line 709 of file beobot-GSnav-master.C.

References BeobotConfig::gearMaxVal, BeobotConfig::gearMinVal, BeobotConfig::gearNeutralVal, BeobotConfig::gearServoNum, LINFO, BeobotConfig::pwm0MaxVal, BeobotConfig::pwm0MinVal, BeobotConfig::pwm0NeutralVal, BeobotConfig::pwm1MaxVal, BeobotConfig::pwm1MinVal, BeobotConfig::pwm1NeutralVal, BeobotConfig::speedMaxVal, BeobotConfig::speedMinVal, BeobotConfig::speedNeutralVal, BeobotConfig::speedServoNum, BeobotConfig::steerMaxVal, BeobotConfig::steerMinVal, BeobotConfig::steerNeutralVal, and BeobotConfig::steerServoNum.

void setupDorsalPacket TCPmessage smsg,
int  rframe,
ImageSet< float >  cmap,
bool  resetCurrLandmark,
std::vector< Point2D< int > >  clmpt,
bool  resetNextLandmark,
std::vector< Point2D< int > >  nlmpt
 

setup the packet containing cmaps for tracking

Definition at line 995 of file beobot-GSnav-master.C.

References TCPmessage::addImageSet(), TCPmessage::addInt32(), i, LDEBUG, TCPmessage::reset(), Image< T >::size(), and TRACK_LM.

Referenced by main().

void setupVentralPacket TCPmessage smsg,
int  rframe,
bool  resetVentralSearch,
Image< PixRGB< byte > >  currIma,
Image< double >  cgist,
std::vector< Point2D< int > >  salpt,
std::vector< std::vector< double > >  feat,
std::vector< Rectangle objRect,
float  dx,
float  dy,
uint  snumGT,
float  ltravGT
 

setup the packat containing the salient region information to be recognized by the ventral module

Definition at line 940 of file beobot-GSnav-master.C.

References TCPmessage::addDouble(), TCPmessage::addFloat(), TCPmessage::addImage(), TCPmessage::addInt32(), convertToString(), i, LDEBUG, TCPmessage::reset(), SEARCH_LM, and top.

Referenced by main().

void terminate int  s  ) 
 

Signal handler (e.g., for control-C).

Definition at line 193 of file beobot-GSnav-master.C.

References goforever, and LERROR.


Generated on Sun Nov 22 13:43:28 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4