real_shadowhand_node.cpp
Go to the documentation of this file.
1 
30 #include <ros/ros.h>
31 
32 #include <boost/thread/thread.hpp>
33 #include <boost/smart_ptr.hpp>
34 
35 #include "sr_hand/sr_subscriber.h"
36 #include "sr_hand/sr_publisher.h"
39 
40 using ros::NodeHandle;
41 using ros::ok;
47 
49 // MAIN //
51 
53 {
54  while (ok())
55  {
56  shadowhand_diag->publish();
57  }
58 }
59 
61 {
62  while (ok())
63  {
64  shadowhand_pub->publish();
65  }
66 }
67 
79 int main(int argc, char **argv)
80 {
81  ros::init(argc, argv, "shadowhand");
82  NodeHandle n;
83 
85  boost::shared_ptr <SRSubscriber> shadowhand_subscriber(new SRSubscriber(real_sh));
86 
87 
88  boost::shared_ptr <SRPublisher> shadowhand_pub(new SRPublisher(real_sh));
90 
91  boost::thread
92  thrd1(boost::bind(&run_diagnotics, shadowhand_diag));
93  boost::thread
94  thrd2(boost::bind(&run_publisher, shadowhand_pub));
95  thrd1.join();
96  thrd2.join();
97 
98  return 0;
99 }
void run_publisher(boost::shared_ptr< SRPublisher > shadowhand_pub)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
The Diagnosticer is a ROS publisher which publishes diagnostic data regarding the Dextrous Hand or th...
This class reads and publishes data concerning the shadowhand / shadowarm. To publish those data...
ROSCPP_DECL bool ok()
int main(int argc, char **argv)
The real shadowhand is the ROS interface to Shadow Robot robotic hand.
void run_diagnotics(boost::shared_ptr< SRDiagnosticer > shadowhand_diag)
This ROS subscriber is used to issue commands to the hand / arm, from sending a set of targets...


sr_hand
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:53