ik_ros_i.h
Go to the documentation of this file.
1 #ifndef PHIDGETS_IK_IK_ROS_I_H
2 #define PHIDGETS_IK_IK_ROS_I_H
3 
4 #include <ros/ros.h>
5 #include <phidgets_api/ik.h>
6 #include <std_msgs/Bool.h>
7 #include <std_msgs/Float32.h>
8 #include "phidgets_ik/SetDigitalOutput.h"
9 
10 #include <vector>
11 #include <boost/shared_ptr.hpp>
12 
13 namespace phidgets {
14 
15 class OutputSetter {
16  public:
17  OutputSetter(CPhidgetInterfaceKitHandle ik_handle, int index);
18  virtual void set_msg_callback(const std_msgs::Bool::ConstPtr& msg);
20  protected:
21  int index;
22  CPhidgetInterfaceKitHandle ik_handle_;
23 };
24 
25 class IKRosI : public IK
26 {
27 
28  public:
29 
30  IKRosI(ros::NodeHandle nh, ros::NodeHandle nh_private);
31 
32  protected:
33 
34  int n_in;
35  int n_out;
36  int n_sensors;
37  std::vector<ros::Publisher> in_pubs_;
38  std::vector<ros::Publisher> sensor_pubs_;
40  std::vector<boost::shared_ptr<OutputSetter> > out_subs_;
41 
42  private:
43 
46 
47  const float VREF;
48 
49  void initDevice();
50  void sensorHandler(int index, int sensorValue);
51  void inputHandler(int index, int inputValue);
52 
53  bool set_srv_callback(phidgets_ik::SetDigitalOutput::Request& req, phidgets_ik::SetDigitalOutput::Response &res);
54 };
55 
56 } //namespace phidgets
57 
58 #endif // PHIDGETS_IK_IK_ROS_I_H
CPhidgetInterfaceKitHandle ik_handle_
Definition: ik_ros_i.h:22
std::vector< ros::Publisher > sensor_pubs_
Definition: ik_ros_i.h:38
ros::NodeHandle nh_
Definition: ik_ros_i.h:44
const float VREF
Definition: ik_ros_i.h:47
OutputSetter(CPhidgetInterfaceKitHandle ik_handle, int index)
Definition: ik_ros_i.cpp:99
std::vector< ros::Publisher > in_pubs_
Definition: ik_ros_i.h:37
std::vector< boost::shared_ptr< OutputSetter > > out_subs_
Definition: ik_ros_i.h:40
virtual void set_msg_callback(const std_msgs::Bool::ConstPtr &msg)
Definition: ik_ros_i.cpp:93
ros::ServiceServer out_srv_
Definition: ik_ros_i.h:39
ros::NodeHandle nh_private_
Definition: ik_ros_i.h:45
ros::Subscriber subscription
Definition: ik_ros_i.h:19


phidgets_ik
Author(s): James Sarrett
autogenerated on Tue May 7 2019 03:19:28