Main Page
Namespaces
Classes
Files
File List
File Members
src
denso_robot_control.cpp
Go to the documentation of this file.
1
25
#include <
ros/ros.h
>
26
#include <
controller_manager/controller_manager.h
>
27
#include "
denso_robot_control/denso_robot_hw.h
"
28
29
int
main
(
int
argc,
char
*argv[])
30
{
31
ros::init
(argc, argv,
"denso_robot_control"
);
32
ros::NodeHandle
nh;
33
34
denso_robot_control::DensoRobotHW
drobo;
35
HRESULT
hr = drobo.
Initialize
();
36
if
(
SUCCEEDED
(hr)) {
37
controller_manager::ControllerManager
cm(&drobo, nh);
38
39
ros::Rate
rate(1.0 / drobo.
getPeriod
().
toSec
());
40
ros::AsyncSpinner
spinner
(1);
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
}
DurationBase< Duration >::toSec
double toSec() const
controller_manager::ControllerManager
ros::NodeHandle
denso_robot_control::DensoRobotHW::read
void read(ros::Time, ros::Duration)
Definition:
denso_robot_hw.cpp:315
start
ROSCPP_DECL void start()
main
int main(int argc, char *argv[])
Definition:
denso_robot_control.cpp:29
ros::Time
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Rate
denso_robot_hw.h
denso_robot_control::DensoRobotHW::getTime
ros::Time getTime() const
Definition:
denso_robot_hw.h:62
denso_robot_control::DensoRobotHW::write
void write(ros::Time, ros::Duration)
Definition:
denso_robot_hw.cpp:342
denso_robot_control::DensoRobotHW::getPeriod
ros::Duration getPeriod() const
Definition:
denso_robot_hw.h:67
spinner
void spinner()
denso_robot_control::DensoRobotHW
Definition:
denso_robot_hw.h:54
HRESULT
int32_t HRESULT
ros::ok
ROSCPP_DECL bool ok()
SUCCEEDED
#define SUCCEEDED(hr)
denso_robot_control::DensoRobotHW::Initialize
HRESULT Initialize()
Definition:
denso_robot_hw.cpp:66
ros.h
ros::Duration
controller_manager.h
controller_manager::ControllerManager::update
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)
ros::AsyncSpinner
denso_robot_control
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:33