denso_robot_rc8.h
Go to the documentation of this file.
1 
25 #ifndef _DENSO_ROBOT_RC8_H_
26 #define _DENSO_ROBOT_RC8_H_
27 
28 #include <boost/thread.hpp>
30 
31 #define S_BUF_FULL (0x0F200501)
32 #define E_BUF_FULL (0x83201483)
33 
34 namespace denso_robot_core {
35 
36 class DensoRobotRC8 : public DensoRobot
37 {
38  friend class DensoRobotCore;
39 
40 public:
41  enum {
43  SLVMODE_POSE_P = 0x0001,
44  SLVMODE_POSE_J = 0x0002,
45  SLVMODE_POSE_T = 0x0003,
46  SLVMODE_POSE = 0x000F,
47  SLVMODE_ASYNC = 0x0100,
49  };
50 
51  enum {
53  SENDFMT_HANDIO = 0x0020,
54  SENDFMT_MINIIO = 0x0100,
55  SENDFMT_USERIO = 0x0200,
56  };
57 
58  enum {
60  RECVFMT_POSE_P = 0x0001,
61  RECVFMT_POSE_J = 0x0002,
62  RECVFMT_POSE_T = 0x0003,
63  RECVFMT_POSE_PJ = 0x0004,
64  RECVFMT_POSE_TJ = 0x0005,
65  RECVFMT_POSE = 0x000F,
66  RECVFMT_TIME = 0x0010,
67  RECVFMT_HANDIO = 0x0020,
68  RECVFMT_CURRENT = 0x0040,
69  RECVFMT_MINIIO = 0x0100,
70  RECVFMT_USERIO = 0x0200,
71  };
72 
73  enum {
76  };
77 
78 public:
79  DensoRobotRC8(DensoBase* parent,
80  Service_Vec& service, Handle_Vec& handle,
81  const std::string& name, const int* mode);
82 
84 
87 
88  bool Update();
89 
92  HRESULT ExecMove(int comp, const VARIANT_Ptr& pose, const std::string& option);
93  HRESULT ExecDrive(const std::string& name, const VARIANT_Ptr& option);
94  HRESULT ExecSpeed(float value);
95  HRESULT ExecChange(const std::string& value);
96  HRESULT ExecHalt();
97  HRESULT ExecCurJnt(std::vector<double>& pose);
98 
99  HRESULT ExecSlaveMove(const std::vector<double>& pose, std::vector<double>& joint);
100 
101  int get_SendFormat() const;
102  void put_SendFormat(int format);
103  int get_RecvFormat() const;
104  void put_RecvFormat(int format);
105  int get_TimeFormat() const;
106  void put_TimeFormat(int format);
107 
108  int get_MiniIO() const;
109  void put_MiniIO(int value);
110  int get_HandIO() const;
111  void put_HandIO(int value);
112  void put_SendUserIO(const UserIO& value);
113  void put_RecvUserIO(const UserIO& value);
114  void get_RecvUserIO(UserIO& value) const;
115  void get_Current(std::vector<double> &current) const;
116  int get_Timestamp() const;
117 
118 private:
119  HRESULT ChangeMode(int mode);
120  HRESULT ExecSlaveMode(const std::string& name, int32_t format, int32_t option = 0);
121 
122  HRESULT CreateSendParameter(const std::vector<double>& pose, VARIANT_Ptr& send,
123  const int miniio = 0, const int handio = 0,
124  const int recv_userio_offset = 0, const int recv_userio_size = 0,
125  const int send_userio_offset = 0, const int send_userio_size = 0,
126  const std::vector<uint8_t>& send_userio = std::vector<uint8_t>());
127 
129  std::vector<double>& position, std::vector<double>& joint, std::vector<double>& trans,
130  int& miniio, int& handio, int& timestamp,
131  std::vector<uint8_t>& recv_userio,
132  std::vector<double>& current);
133 
134 private:
135  void Callback_MoveString(const MoveStringGoalConstPtr& goal);
136  void Callback_MoveValue(const MoveValueGoalConstPtr& goal);
137  void Callback_DriveString(const std::string& name, const DriveStringGoalConstPtr& goal);
138  void Callback_DriveValue(const std::string& name, const DriveValueGoalConstPtr& goal);
139  void Callback_Speed(const Float32::ConstPtr& msg);
140  void Callback_Change(const std::string& name, const Int32::ConstPtr& msg);
141  void Callback_Cancel();
142  void Action_Feedback();
143 
144 private:
148 
155 
156  int m_curAct;
157  boost::mutex m_mtxAct;
158 
160  unsigned int m_memRetry;
161 
167  std::vector<uint8_t> m_send_userio, m_recv_userio;
168  std::vector<double> m_position, m_joint, m_trans, m_current;
169 };
170 
172 
173 }
174 
175 #endif
void get_RecvUserIO(UserIO &value) const
unsigned uint32_t
void Callback_Change(const std::string &name, const Int32::ConstPtr &msg)
HRESULT ParseRecvParameter(const VARIANT_Ptr &recv, std::vector< double > &position, std::vector< double > &joint, std::vector< double > &trans, int &miniio, int &handio, int &timestamp, std::vector< uint8_t > &recv_userio, std::vector< double > &current)
HRESULT StartService(ros::NodeHandle &node)
void Callback_DriveString(const std::string &name, const DriveStringGoalConstPtr &goal)
void put_RecvUserIO(const UserIO &value)
std::vector< uint8_t > m_recv_userio
void Callback_Speed(const Float32::ConstPtr &msg)
std::vector< uint32_t > Handle_Vec
Definition: denso_base.h:67
boost::shared_ptr< SimpleActionServer< DriveValueAction > > m_actDriveExValue
HRESULT ExecSlaveMode(const std::string &name, int32_t format, int32_t option=0)
std::vector< uint8_t > m_send_userio
std::vector< BCAPService_Ptr > Service_Vec
Definition: denso_base.h:68
void Callback_MoveString(const MoveStringGoalConstPtr &goal)
std::vector< double > m_position
int32_t HRESULT
HRESULT ExecChange(const std::string &value)
HRESULT ExecSlaveMove(const std::vector< double > &pose, std::vector< double > &joint)
std::vector< double > m_trans
std::vector< double > m_current
HRESULT ExecCurJnt(std::vector< double > &pose)
boost::interprocess::unique_ptr< VARIANT, variant_deleter > VARIANT_Ptr
boost::shared_ptr< SimpleActionServer< DriveStringAction > > m_actDriveExString
void Callback_MoveValue(const MoveValueGoalConstPtr &goal)
boost::shared_ptr< DensoRobotRC8 > DensoRobotRC8_Ptr
boost::shared_ptr< SimpleActionServer< DriveStringAction > > m_actDriveAExString
HRESULT ExecDrive(const std::string &name, const VARIANT_Ptr &option)
void get_Current(std::vector< double > &current) const
HRESULT ExecMove(int comp, const VARIANT_Ptr &pose, const std::string &option)
HRESULT CreateSendParameter(const std::vector< double > &pose, VARIANT_Ptr &send, const int miniio=0, const int handio=0, const int recv_userio_offset=0, const int recv_userio_size=0, const int send_userio_offset=0, const int send_userio_size=0, const std::vector< uint8_t > &send_userio=std::vector< uint8_t >())
int int32_t
boost::shared_ptr< SimpleActionServer< MoveValueAction > > m_actMoveValue
DensoRobotRC8(DensoBase *parent, Service_Vec &service, Handle_Vec &handle, const std::string &name, const int *mode)
boost::shared_ptr< SimpleActionServer< MoveStringAction > > m_actMoveString
boost::shared_ptr< SimpleActionServer< DriveValueAction > > m_actDriveAExValue
void put_SendUserIO(const UserIO &value)
std::vector< double > m_joint
void Callback_DriveValue(const std::string &name, const DriveValueGoalConstPtr &goal)


denso_robot_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:27