INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

hydrodrivers/hydromhipa10arcnet/driver.h

00001 /*************************************************************************
00002         
00003         date            : August 2008
00004         copyright       : (C) 2005 J.D. Yamokoski
00005         email   : yamokosk+gnu at gmail dot com
00006 
00007  This library is free software; you can redistribute it and/or
00008  modify it under the terms of the GNU Lesser General Public License as
00009  published by the Free Software Foundation; either version 2.1 of the License,
00010  or (at your option) any later version. The text of the GNU Lesser General
00011  Public License is included with this library in the file LICENSE.TXT.
00012  
00013  This library is distributed in the hope that it will be useful, but WITHOUT
00014  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015  or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE.TXT for
00016  more details.
00017  
00018  *************************************************************************/
00019 
00020  
00021 #ifndef HYDRO_MHI_PA10_ARCNET_H
00022 #define HYDRO_MHI_PA10_ARCNET_H
00023 
00024 #include <hydrointerfaces/mhipa10.h>
00025 
00026 #include "arcnetio.h"
00027 #include "response.h"
00028 #include "unitconverter.h"
00029 #include "model.h"
00030 
00031                                         
00032 namespace mhipa10arc
00033 {
00034 
00035 /*
00036         An implementation of HwHandler that knows how to talk the PA10
00037         protocol.  Requires a hardware interface implementation to be
00038         passed to the constructor.
00039 
00040         @author J.D. Yamokoski
00041 */
00042 class Driver : public hydrointerfaces::MitsubishiPA10
00043 {
00044 public:
00045         Driver( const hydrointerfaces::MitsubishiPA10::ManipulatorConfig& config, const hydroutil::Context& context );
00046         virtual ~Driver();
00047         
00048         // from MitsubishiPA10
00049         virtual void enable();
00050         virtual bool read( ManipulatorData& data );
00051         virtual void write( const ManipulatorCommand& command );
00052         virtual void getStatus( std::string &status, bool &isWarn, bool &isFault );
00053                 
00054         // To start and stop motion control
00055         void startMotionControl();
00056         void stopMotionControl();
00057 
00058         // Returns whether the PA10 is accepting motion control commands
00059         bool isMotionEnabled() {return isMotionControlStarted_;}
00060 private:        
00061         // Clears any servo alarms
00062         void clearAlarms();
00063         
00064         virtual void checkCommand( ManipulatorCommand& cmd );
00065         
00066         // Reading to and writing from the PA10 is a coupled.
00067         MessagePtr doMessageExchange(MessagePtr sendmsg);
00068         
00069         // Most-recently-received data stored as a smart pointer
00070         MotionCommandResponsePtr lastCmdResponse_;
00071         
00072         // Arcnet interface on which to talk to PA10
00073         ArcnetIO iodev_;
00074         
00075         // Flag to remember if new data has come in since the previous read attempt
00076         bool isNewData_;
00077         
00078         // Flag to remember if the start motion control command was sent
00079         bool isMotionControlStarted_;
00080         
00081         // Local storage of the manipulator description
00082         ManipulatorConfig config_;
00083         
00084         hydroutil::Context context_;
00085 };
00086 
00087 class MitsubishiPA106CFactory : public hydrointerfaces::MitsubishiPA10Factory
00088 {
00089 public:
00090         virtual ~MitsubishiPA106CFactory() {};
00092         virtual hydrointerfaces::MitsubishiPA10* createDriver( const hydrointerfaces::MitsubishiPA10::ManipulatorConfig& config, const hydroutil::Context& context ) const;
00093 };
00094 
00095 
00096 } // namespace
00097 
00098 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5