YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
Ros2Spinner.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2023 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#include "
Ros2Spinner.h
"
7
8
#include <
yarp/os/Log.h
>
9
#include <
yarp/os/LogComponent.h
>
10
#include <
yarp/os/LogStream.h
>
11
12
namespace
{
13
YARP_LOG_COMPONENT
(ROS2SPINNER,
"yarp.ros2.Ros2Spinner"
)
14
}
15
16
Ros2Spinner::Ros2Spinner
(std::shared_ptr<rclcpp::Node> input_node) :
17
m_node(input_node)
18
{}
19
20
void
Ros2Spinner::run
()
21
{
22
if
(!m_spun)
23
{
24
m_spun =
true
;
25
rclcpp::spin(m_node);
26
}
27
}
28
29
Ros2Spinner::~Ros2Spinner
()
30
{
31
if
(m_spun)
32
{
33
rclcpp::shutdown();
34
m_spun =
false
;
35
}
36
}
LogStream.h
Log.h
Ros2Spinner.h
Ros2Spinner::run
void run() override
Main body of the new thread.
Definition
Ros2Spinner.cpp:20
Ros2Spinner::~Ros2Spinner
~Ros2Spinner()
Definition
Ros2Spinner.cpp:29
Ros2Spinner::Ros2Spinner
Ros2Spinner(std::shared_ptr< rclcpp::Node > input_node)
Definition
Ros2Spinner.cpp:16
LogComponent.h
YARP_LOG_COMPONENT
#define YARP_LOG_COMPONENT(name,...)
Definition
LogComponent.h:76
YARP
3.11.100+20250603.4+gitaa77f8b5c
opt-modules
yarp-devices-ros2
src
devices
ros2Utils
Ros2Spinner.cpp
Generated on Wed Jun 4 2025 02:39:56 for YARP by
1.9.8