robotiq_3f_gripper_can_client.h
Go to the documentation of this file.
1 // Copyright (c) 2016, Toyota Research Institute. All rights reserved.
2 
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
5 
6 // 1. Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 
9 // 2. Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 
13 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 
25 #ifndef ROBOTIQ_3F_GRIPPER_CAN_CLIENT_H
26 #define ROBOTIQ_3F_GRIPPER_CAN_CLIENT_H
27 
31 
33 {
34 
42 {
43 public:
45 
47 
48 
49  void init(ros::NodeHandle nh);
50 
56  void writeOutputs(const GripperOutput& output);
57 
62  GripperInput readInputs() const;
63 
68  GripperOutput readOutputs() const;
69 
70 private:
71  unsigned int can_id_;
73  std::string can_device_;
75 
78 
81 
82  void frameCallback(const can::Frame &f);
83  void stateCallback(const can::State &s);
84 
85  void requestStart();
86 
87  std::map<unsigned char, unsigned char> prevCmd_;
88 
89  mutable boost::timed_mutex read_mutex;
90 
91  void decodeGripperStatus(const u_int8_t &f);
92  void decodeObjectStatus(const u_int8_t &f);
93  void decodeFaultStatus(const u_int8_t &f);
94  void decodeFingerAPos(const u_int8_t &f);
95  void decodeFingerBPos(const u_int8_t &f);
96  void decodeFingerCPos(const u_int8_t &f);
97  void decodeFingerSPos(const u_int8_t &f);
98  void decodeFingerACurrent(const u_int8_t &f);
99  void decodeFingerBCurrent(const u_int8_t &f);
100  void decodeFingerCCurrent(const u_int8_t &f);
101  void decodeFingerSCurrent(const u_int8_t &f);
102  void decodeFingerAPosCmd(const u_int8_t &f);
103  void decodeFingerBPosCmd(const u_int8_t &f);
104  void decodeFingerCPosCmd(const u_int8_t &f);
105  void decodeFingerSPosCmd(const u_int8_t &f);
106 };
107 
108 } //end namespace robotiq_3f_gripper_control
109 
110 #endif // ROBOTIQ_3F_GRIPPER_CAN_CLIENT_H
robotiq_3f_gripper_articulated_msgs::Robotiq3FGripperRobotOutput GripperOutput
GripperOutput readOutputs() const
Reads set of output-register values from the gripper.
can::StateInterface::StateListenerConstSharedPtr state_listener_
can::CommInterface::FrameListenerConstSharedPtr frame_listener_
Robotiq3FGripperCanClient(unsigned int can_id, boost::shared_ptr< can::DriverInterface > driver)
This class provides a client for the EtherCAT manager object that can translate robot input/output me...
robotiq_3f_gripper_articulated_msgs::Robotiq3FGripperRobotInput GripperInput
void writeOutputs(const GripperOutput &output)
Write the given set of control flags to the memory of the gripper.
GripperInput readInputs() const
Reads set of input-register values from the gripper.


robotiq_3f_gripper_control
Author(s): Nicolas Lauzier (Robotiq inc.), Allison Thackston
autogenerated on Tue Jun 1 2021 02:29:58