denso_robot_control.cpp
Go to the documentation of this file.
1 
25 #include <ros/ros.h>
28 
29 int main(int argc, char *argv[])
30 {
31  ros::init(argc, argv, "denso_robot_control");
32  ros::NodeHandle nh;
33 
35  HRESULT hr = drobo.Initialize();
36  if(SUCCEEDED(hr)) {
38 
39  ros::Rate rate(1.0 / drobo.getPeriod().toSec());
41  spinner.start();
42 
43  ros::Time start = drobo.getTime();
44  while(ros::ok())
45  {
46  ros::Time now = drobo.getTime();
47  ros::Duration dt = drobo.getPeriod();
48 
49  drobo.read(now, dt);
50 
51  cm.update(now, dt);
52 
53  ros::Duration diff = now - start;
54  if(diff.toSec() > 5) {
55  drobo.write(now, dt);
56  }
57 
58  rate.sleep();
59  }
60  spinner.stop();
61  }
62 
63  return 0;
64 }
void read(ros::Time, ros::Duration)
ROSCPP_DECL void start()
int main(int argc, char *argv[])
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void write(ros::Time, ros::Duration)
ros::Duration getPeriod() const
void spinner()
int32_t HRESULT
ROSCPP_DECL bool ok()
#define SUCCEEDED(hr)
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)


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