Main Page
Namespaces
Classes
Files
File List
File Members
src
packml_ros_node.cpp
Go to the documentation of this file.
1
/*
2
* Software License Agreement (Apache License)
3
*
4
* Copyright (c) 2017 Shaun Edwards
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
19
#include <
ros/ros.h
>
20
#include <
packml_ros/packml_ros.h
>
21
#include <
packml_sm/boost/packml_state_machine_continuous.h
>
22
23
int
myExecuteMethod
()
24
{
25
ROS_INFO_STREAM
(
"This is my execute method(begin)"
);
26
ros::Duration
(1.0).
sleep
();
27
ROS_INFO_STREAM
(
"This is my execute method(end)"
);
28
return
0;
// returning zero indicates non-failure
29
}
30
31
int
main
(
int
argc,
char
* argv[])
32
{
33
ros::init
(argc, argv,
"packml_node"
);
34
auto
sm =
packml_sm::PackmlStateMachineContinuous::spawn
();
35
sm->setExecute(std::bind(
myExecuteMethod
));
36
37
packml_ros::PackmlRos
sm_node(
ros::NodeHandle
(),
ros::NodeHandle
(
"~"
), sm);
38
sm_node.
spin
();
39
40
return
0;
41
}
ros::NodeHandle
packml_state_machine_continuous.h
ros::Duration::sleep
bool sleep() const
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
myExecuteMethod
int myExecuteMethod()
Definition:
packml_ros_node.cpp:23
packml_ros.h
packml_ros::PackmlRos
Definition:
packml_ros.h:31
main
int main(int argc, char *argv[])
Definition:
packml_ros_node.cpp:31
ros.h
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
ros::Duration
packml_sm::PackmlStateMachineContinuous::spawn
static std::shared_ptr< PackmlStateMachineContinuous > spawn()
packml_ros::PackmlRos::spin
void spin()
Definition:
packml_ros.cpp:52
packml_ros
Author(s): Shaun Edwards
autogenerated on Fri Jul 12 2019 03:31:00