darwin_teleop_alg.cpp
Go to the documentation of this file.
00001 #include "darwin_teleop_alg.h"
00002 
00003 DarwinTeleopAlgorithm::DarwinTeleopAlgorithm(void)
00004 {
00005 }
00006 
00007 DarwinTeleopAlgorithm::~DarwinTeleopAlgorithm(void)
00008 {
00009 }
00010 
00011 void DarwinTeleopAlgorithm::config_update(Config& new_cfg, uint32_t level)
00012 {
00013   this->lock();
00014 
00015   // save the current configuration
00016   this->config_=new_cfg;
00017   
00018   this->unlock();
00019 }
00020 
00021 // DarwinTeleopAlgorithm Public API
00022 bool DarwinTeleopAlgorithm::check_pressed_button_callback(const std::vector<int> & buttons, std::vector<unsigned int> & index)
00023 {
00024   if (buttons.size() == 0)
00025     return false;
00026 
00027   bool new_data = false;
00028   for (unsigned int i=0; i<buttons.size(); i++)
00029   {
00030     if (buttons[i] != 0)
00031     {
00032       new_data = true;
00033       index.push_back(i);
00034     }
00035   }
00036 
00037   return new_data;
00038 }
00039 
00040 bool DarwinTeleopAlgorithm::compareIndexVectors(const std::vector<unsigned int> & a, const std::vector<unsigned int> & b)
00041 {
00042   if( a.size() != b.size() )
00043     return false;
00044 
00045   return std::equal(a.begin(), a.end(), b.begin());;
00046 }
00047 


darwin_teleop
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 20:22:28