darwin_robot_driver.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2011 Institut de Robotica i Informatica Industrial, CSIC-UPC.
00002 // Author 
00003 // All rights reserved.
00004 //
00005 // This file is part of iri-ros-pkg
00006 // iri-ros-pkg is free software: you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License as published by
00008 // the Free Software Foundation, either version 3 of the License, or
00009 // at your option) any later version.
00010 //
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 // 
00019 // IMPORTANT NOTE: This code has been generated through a script from the 
00020 // iri_ros_scripts. Please do NOT delete any comments to guarantee the correctness
00021 // of the scripts. ROS topics can be easly add by using those scripts. Please
00022 // refer to the IRI wiki page for more information:
00023 // http://wikiri.upc.es/index.php/Robotics_Lab
00024 
00025 #ifndef _darwin_node_driver_h_
00026 #define _darwin_node_driver_h_
00027 
00028 #include <iri_base_driver/iri_base_driver.h>
00029 #include <iri_darwin_robot/DarwinRobotConfig.h>
00030 
00031 //include darwin_node_driver main library
00032 #include "darwin_robot.h"
00033 #include "darwin_exceptions.h"
00034 
00054 class DarwinRobotDriver : public iri_base_driver::IriBaseDriver
00055 {
00056   private:
00057     // private attributes and methods
00058     CDarwin *robot;
00059     // sub controller device identifier
00060     std::string CM730_device;
00061     // action file path
00062     std::string action_file;
00063     // configuration file path
00064     std::string config_file;
00065   public:
00072     typedef iri_darwin_robot::DarwinRobotConfig Config;
00073 
00080     Config config_;
00081 
00090     DarwinRobotDriver(void);
00091 
00102     bool openDriver(void);
00103 
00114     bool closeDriver(void);
00115 
00126     bool startDriver(void);
00127 
00138     bool stopDriver(void);
00139 
00151     void config_update(Config& new_cfg, uint32_t level=0);
00152 
00153     // here define all darwin_node_driver interface methods to retrieve and set
00154     // the driver parameters
00155     std::vector<double> get_current_angles(void);
00156     // Walking interface
00157     void start_walking(double x_dist, double y_dist, double turn_angle);
00158     void tune_walking(double x_dist,double y_dist, double turn_angle);
00159     void set_walking_param(motion_params param, double value);
00160     double get_walking_param(motion_params param);
00161     void stop_walking(void);
00162     bool is_walking(void);
00163     // action interface
00164     void start_action(unsigned int action_index);
00165     void start_action(std::string &action_name);
00166     void stop_action(void);
00167     void break_action(void);
00168     bool action_is_running(void);
00169     // Head public interface
00170     void get_head_position(double *pan, double *tilt);
00171     void set_head_position(double pan, double tilt);
00172     // sensor interface
00173     void get_gyroscope(double *x,double *y, double *z);
00174     void get_accelerometer(double *x, double *y, double *z);
00175     void get_analog_channel(analogs id,double *value);
00176     // joint motion public interface
00177     std::string move_joints(std::vector<int> &servos,std::vector<double> &angles,std::vector<double> &speeds, std::vector<double> &accels, const std::string &target_id=std::string(""));
00178     bool joints_are_moving(std::string &target_id);
00179     void stop_joints(std::string &target_id);
00180     // tracking public interface
00181     void start_head_tracking(void);
00182     void stop_head_tracking(void);
00183     void set_tracking_pid(int t, TPID *pan_pid, TPID *tilt_pid);
00184     void get_tracking_pid(int *t, TPID *pan_pid, TPID *tilt_pid);
00185     void set_tracking_target(double pan, double tilt);
00186     void get_tracking_target(double *pan, double *tilt);
00193     ~DarwinRobotDriver(void);
00194 };
00195 
00196 #endif


iri_darwin_robot
Author(s): shernand
autogenerated on Fri Dec 6 2013 20:53:54