diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..f66e631e
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,57 @@
+name: Lint
+
+# Controls when the action will run. Triggers the workflow on push or pull request
+on:
+ push:
+ branches: [ ros2, ros2-devel, dashing-devel, eloquent-devel, foxy-devel ]
+ pull_request:
+ branches: [ ros2, ros2-devel ]
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ ament_lint_bionic:
+ runs-on: ubuntu-18.04
+ strategy:
+ fail-fast: false
+ matrix:
+ linter: [copyright, cppcheck, cpplint, uncrustify, pep8, pep257, xmllint]
+ distribution: [dashing, eloquent]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ros-tooling/setup-ros@master
+ - uses: ros-tooling/action-ros-lint@master
+ with:
+ distribution: ${{ matrix.distribution }}
+ linter: ${{ matrix.linter }}
+ package-name: |
+ turtlebot3
+ turtlebot3_bringup
+ turtlebot3_cartographer
+ turtlebot3_description
+ turtlebot3_example
+ turtlebot3_navigation2
+ turtlebot3_node
+ turtlebot3_teleop
+ ament_lint_focal:
+ runs-on: ubuntu-20.04
+ strategy:
+ fail-fast: false
+ matrix:
+ linter: [copyright, cppcheck, cpplint, uncrustify, pep257, xmllint] #todo : flake8
+ distribution: [foxy]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ros-tooling/setup-ros@master
+ - uses: ros-tooling/action-ros-lint@master
+ with:
+ distribution: ${{ matrix.distribution }}
+ linter: ${{ matrix.linter }}
+ package-name: |
+ turtlebot3
+ turtlebot3_bringup
+ turtlebot3_cartographer
+ turtlebot3_description
+ turtlebot3_example
+ turtlebot3_navigation2
+ turtlebot3_node
+ turtlebot3_teleop
diff --git a/.travis.yml b/.travis.yml
index 1e5a3872..f72e301f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,4 +26,4 @@ matrix:
include:
- script: .ros2ci/travis.bash dashing
- script: .ros2ci/travis.bash eloquent
- - script: .ros2ci/travis.bash nightly
+ - script: .ros2ci/travis.bash foxy
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..cfba094d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,18 @@
+Any contribution that you make to this repository will
+be under the Apache 2 License, as dictated by that
+[license](http://www.apache.org/licenses/LICENSE-2.0.html):
+
+~~~
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+~~~
+
+Contributors must sign-off each commit by adding a `Signed-off-by: ...`
+line to commit messages to certify that they have the right to submit
+the code they are contributing to the project according to the
+[Developer Certificate of Origin (DCO)](https://developercertificate.org/).
diff --git a/LICENSE b/LICENSE
index 8dada3ed..f4f87bd4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,4 @@
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -178,7 +179,7 @@
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
+ boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
@@ -186,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright {yyyy} {name of copyright owner}
+ Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -199,3 +200,4 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
\ No newline at end of file
diff --git a/turtlebot3/package.xml b/turtlebot3/package.xml
index 641726de..f6710115 100644
--- a/turtlebot3/package.xml
+++ b/turtlebot3/package.xml
@@ -6,15 +6,14 @@
ROS 2 packages for TurtleBot3
+ Will Son
Apache 2.0
+ http://turtlebot3.robotis.com
+ https://github.com/ROBOTIS-GIT/turtlebot3
+ https://github.com/ROBOTIS-GIT/turtlebot3/issues
Darby Lim
Ryan Shim
Pyo
- Will Son
- http://wiki.ros.org/turtlebot3_description
- http://turtlebot3.robotis.com
- https://github.com/ROBOTIS-GIT/turtlebot3
- https://github.com/ROBOTIS-GIT/turtlebot3/issues
ament_cmake
turtlebot3_bringup
turtlebot3_cartographer
diff --git a/turtlebot3_bringup/launch/robot.launch.py b/turtlebot3_bringup/launch/robot.launch.py
index 2c496bb6..863b92f6 100644
--- a/turtlebot3_bringup/launch/robot.launch.py
+++ b/turtlebot3_bringup/launch/robot.launch.py
@@ -48,9 +48,9 @@ def generate_launch_description():
return LaunchDescription([
DeclareLaunchArgument(
- 'use_sim_time',
- default_value=use_sim_time,
- description='Use simulation (Gazebo) clock if true'),
+ 'use_sim_time',
+ default_value=use_sim_time,
+ description='Use simulation (Gazebo) clock if true'),
DeclareLaunchArgument(
'usb_port',
diff --git a/turtlebot3_bringup/launch/rviz2.launch.py b/turtlebot3_bringup/launch/rviz2.launch.py
index 75afe6b4..810c5b26 100644
--- a/turtlebot3_bringup/launch/rviz2.launch.py
+++ b/turtlebot3_bringup/launch/rviz2.launch.py
@@ -25,9 +25,9 @@
def generate_launch_description():
rviz_config_dir = os.path.join(
- get_package_share_directory('turtlebot3_description'),
- 'rviz',
- 'model.rviz')
+ get_package_share_directory('turtlebot3_description'),
+ 'rviz',
+ 'model.rviz')
return LaunchDescription([
Node(
diff --git a/turtlebot3_bringup/package.xml b/turtlebot3_bringup/package.xml
index 457a2c78..da6b4b15 100644
--- a/turtlebot3_bringup/package.xml
+++ b/turtlebot3_bringup/package.xml
@@ -6,14 +6,13 @@
ROS 2 launch scripts for starting the TurtleBot3
- Apache 2.0
- Darby Lim
- Pyo
Will Son
- http://wiki.ros.org/turtlebot3_bringup
- http://turtlebot3.robotis.com
+ Apache 2.0
+ http://turtlebot3.robotis.com
https://github.com/ROBOTIS-GIT/turtlebot3
https://github.com/ROBOTIS-GIT/turtlebot3/issues
+ Darby Lim
+ Pyo
ament_cmake
hls_lfcd_lds_driver
robot_state_publisher
diff --git a/turtlebot3_cartographer/launch/cartographer.launch.py b/turtlebot3_cartographer/launch/cartographer.launch.py
index 16f6542c..b6de9558 100644
--- a/turtlebot3_cartographer/launch/cartographer.launch.py
+++ b/turtlebot3_cartographer/launch/cartographer.launch.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+#
# Author: Darby Lim
import os
@@ -24,17 +24,20 @@
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir
+
def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
turtlebot3_cartographer_prefix = get_package_share_directory('turtlebot3_cartographer')
- cartographer_config_dir = LaunchConfiguration('cartographer_config_dir',
- default=os.path.join(turtlebot3_cartographer_prefix, 'config'))
- configuration_basename = LaunchConfiguration('configuration_basename', default='turtlebot3_lds_2d.lua')
+ cartographer_config_dir = LaunchConfiguration('cartographer_config_dir', default=os.path.join(
+ turtlebot3_cartographer_prefix, 'config'))
+ configuration_basename = LaunchConfiguration('configuration_basename',
+ default='turtlebot3_lds_2d.lua')
resolution = LaunchConfiguration('resolution', default='0.05')
publish_period_sec = LaunchConfiguration('publish_period_sec', default='1.0')
- rviz_config_dir = os.path.join(get_package_share_directory('turtlebot3_cartographer'), 'rviz', 'tb3_cartographer.rviz')
+ rviz_config_dir = os.path.join(get_package_share_directory('turtlebot3_cartographer'),
+ 'rviz', 'tb3_cartographer.rviz')
return LaunchDescription([
DeclareLaunchArgument(
@@ -56,7 +59,8 @@ def generate_launch_description():
node_name='cartographer_node',
output='screen',
parameters=[{'use_sim_time': use_sim_time}],
- arguments=['-configuration_directory', cartographer_config_dir, '-configuration_basename', configuration_basename]),
+ arguments=['-configuration_directory', cartographer_config_dir,
+ '-configuration_basename', configuration_basename]),
DeclareLaunchArgument(
'resolution',
@@ -70,7 +74,8 @@ def generate_launch_description():
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/occupancy_grid.launch.py']),
- launch_arguments={'use_sim_time': use_sim_time, 'resolution': resolution, 'publish_period_sec': publish_period_sec}.items(),
+ launch_arguments={'use_sim_time': use_sim_time, 'resolution': resolution,
+ 'publish_period_sec': publish_period_sec}.items(),
),
Node(
diff --git a/turtlebot3_cartographer/launch/occupancy_grid.launch.py b/turtlebot3_cartographer/launch/occupancy_grid.launch.py
index 175bb116..9a8cc400 100644
--- a/turtlebot3_cartographer/launch/occupancy_grid.launch.py
+++ b/turtlebot3_cartographer/launch/occupancy_grid.launch.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+#
# Author: Darby Lim
from launch import LaunchDescription
@@ -19,6 +19,7 @@
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
+
def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
resolution = LaunchConfiguration('resolution', default='0.05')
diff --git a/turtlebot3_cartographer/package.xml b/turtlebot3_cartographer/package.xml
index 8a9837cd..7c8eee83 100644
--- a/turtlebot3_cartographer/package.xml
+++ b/turtlebot3_cartographer/package.xml
@@ -6,14 +6,13 @@
ROS 2 launch scripts for cartographer
- Apache 2.0
- Darby Lim
- Pyo
Will Son
- http://wiki.ros.org/turtlebot3_bringup
- http://turtlebot3.robotis.com
+ Apache 2.0
+ http://turtlebot3.robotis.com
https://github.com/ROBOTIS-GIT/turtlebot3
https://github.com/ROBOTIS-GIT/turtlebot3/issues
+ Darby Lim
+ Pyo
ament_cmake
cartographer_ros
diff --git a/turtlebot3_description/package.xml b/turtlebot3_description/package.xml
index 4092a7b6..39893c54 100644
--- a/turtlebot3_description/package.xml
+++ b/turtlebot3_description/package.xml
@@ -6,14 +6,13 @@
3D models of the TurtleBot3 for simulation and visualization
- Apache 2.0
- Darby Lim
- Pyo
Will Son
- http://wiki.ros.org/turtlebot3_description
- http://turtlebot3.robotis.com
+ Apache 2.0
+ http://turtlebot3.robotis.com
https://github.com/ROBOTIS-GIT/turtlebot3
https://github.com/ROBOTIS-GIT/turtlebot3/issues
+ Darby Lim
+ Pyo
ament_cmake
urdf
diff --git a/turtlebot3_example/package.xml b/turtlebot3_example/package.xml
index 002aa82e..463fc19e 100644
--- a/turtlebot3_example/package.xml
+++ b/turtlebot3_example/package.xml
@@ -6,14 +6,13 @@
This package provides four basic examples for TurtleBot3 (i.e., interactive marker, object detection, patrol and position control).
- Ryan Shim
- Gilbert
Will Son
Apache 2.0
- http://wiki.ros.org/turtlebot3_example
- http://turtlebot3.robotis.com
+ http://turtlebot3.robotis.com
https://github.com/ROBOTIS-GIT/turtlebot3
https://github.com/ROBOTIS-GIT/turtlebot3/issues
+ Ryan Shim
+ Gilbert
ament_cmake
geometry_msgs
nav_msgs
diff --git a/turtlebot3_example/setup.py b/turtlebot3_example/setup.py
index 2cea807b..bfc5be20 100644
--- a/turtlebot3_example/setup.py
+++ b/turtlebot3_example/setup.py
@@ -1,6 +1,3 @@
-import glob
-import os
-
from setuptools import find_packages
from setuptools import setup
@@ -14,11 +11,14 @@
('share/ament_index/resource_index/packages', ['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
# To be added
- # ('share/' + package_name + '/launch', glob.glob(os.path.join('launch', 'turtlebot3_interactive_marker.launch.py'))),
- # ('share/' + package_name + '/launch', glob.glob(os.path.join('launch', 'turtlebot3_obstacle_detection.launch.py'))),
- # ('share/' + package_name + '/rviz', glob.glob(os.path.join('rviz', 'turtlebot3_interactive_marker.rviz'))),
+ # ('share/' + package_name + '/launch', glob.glob(os.path.join('launch',
+ # 'turtlebot3_interactive_marker.launch.py'))),
+ # ('share/' + package_name + '/launch', glob.glob(os.path.join('launch',
+ # 'turtlebot3_obstacle_detection.launch.py'))),
+ # ('share/' + package_name + '/rviz', glob.glob(os.path.join('rviz',
+ # 'turtlebot3_interactive_marker.rviz'))),
],
- install_requires=['setuptools','launch'],
+ install_requires=['setuptools', 'launch'],
zip_safe=True,
author=['Ryan Shim', 'Gilbert'],
author_email=['jhshim@robotis.com', 'kkjong@robotis.com'],
@@ -38,11 +38,16 @@
entry_points={
'console_scripts': [
# To be added
- # 'turtlebot3_interactive_marker = turtlebot3_example.turtlebot3_interactive_marker.main:main',
- 'turtlebot3_obstacle_detection = turtlebot3_example.turtlebot3_obstacle_detection.main:main',
- 'turtlebot3_patrol_client = turtlebot3_example.turtlebot3_patrol_client.main:main',
- 'turtlebot3_patrol_server = turtlebot3_example.turtlebot3_patrol_server.main:main',
- 'turtlebot3_position_control = turtlebot3_example.turtlebot3_position_control.main:main',
+ # 'turtlebot3_interactive_marker = \
+ # turtlebot3_example.turtlebot3_interactive_marker.main:main',
+ 'turtlebot3_obstacle_detection = \
+ turtlebot3_example.turtlebot3_obstacle_detection.main:main',
+ 'turtlebot3_patrol_client = \
+ turtlebot3_example.turtlebot3_patrol_client.main:main',
+ 'turtlebot3_patrol_server = \
+ turtlebot3_example.turtlebot3_patrol_server.main:main',
+ 'turtlebot3_position_control = \
+ turtlebot3_example.turtlebot3_position_control.main:main',
],
},
)
diff --git a/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py b/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py
index bc556ab2..f1dda6f3 100755
--- a/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py
+++ b/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py
@@ -16,8 +16,6 @@
#
# Authors: Ryan Shim, Gilbert
-import numpy
-
from geometry_msgs.msg import Twist
from rclpy.node import Node
from rclpy.qos import QoSProfile
diff --git a/turtlebot3_example/turtlebot3_example/turtlebot3_position_control/turtlebot3_position_control.py b/turtlebot3_example/turtlebot3_example/turtlebot3_position_control/turtlebot3_position_control.py
index 7850a916..27cb72f6 100755
--- a/turtlebot3_example/turtlebot3_example/turtlebot3_position_control/turtlebot3_position_control.py
+++ b/turtlebot3_example/turtlebot3_example/turtlebot3_position_control/turtlebot3_position_control.py
@@ -108,8 +108,8 @@ def generate_path(self):
# Step 1: Turn
if self.step == 1:
path_theta = math.atan2(
- self.goal_pose_y-self.last_pose_y,
- self.goal_pose_x-self.last_pose_x)
+ self.goal_pose_y - self.last_pose_y,
+ self.goal_pose_x - self.last_pose_x)
angle = path_theta - self.last_pose_theta
angular_velocity = 0.1 # unit: rad/s
@@ -118,8 +118,8 @@ def generate_path(self):
# Step 2: Go Straight
elif self.step == 2:
distance = math.sqrt(
- (self.goal_pose_x-self.last_pose_x)**2
- + (self.goal_pose_y-self.last_pose_y)**2)
+ (self.goal_pose_x - self.last_pose_x)**2 +
+ (self.goal_pose_y - self.last_pose_y)**2)
linear_velocity = 0.1 # unit: m/s
twist, self.step = Turtlebot3Path.go_straight(distance, linear_velocity, self.step)
@@ -159,7 +159,8 @@ def get_key(self):
*******************************************************************************"""
def euler_from_quaternion(self, quat):
"""
- Converts quaternion (w in last place) to euler roll, pitch, yaw
+ Convert quaternion (w in last place) to euler roll, pitch, yaw.
+
quat = [x, y, z, w]
"""
x = quat.x
@@ -167,15 +168,15 @@ def euler_from_quaternion(self, quat):
z = quat.z
w = quat.w
- sinr_cosp = 2 * (w*x + y*z)
- cosr_cosp = 1 - 2*(x*x + y*y)
+ sinr_cosp = 2 * (w * x + y * z)
+ cosr_cosp = 1 - 2 * (x * x + y * y)
roll = numpy.arctan2(sinr_cosp, cosr_cosp)
- sinp = 2 * (w*y - z*x)
+ sinp = 2 * (w * y - z * x)
pitch = numpy.arcsin(sinp)
- siny_cosp = 2 * (w*z + x*y)
- cosy_cosp = 1 - 2 * (y*y + z*z)
+ siny_cosp = 2 * (w * z + x * y)
+ cosy_cosp = 1 - 2 * (y * y + z * z)
yaw = numpy.arctan2(siny_cosp, cosy_cosp)
return roll, pitch, yaw
diff --git a/turtlebot3_navigation2/launch/navigation2.launch.py b/turtlebot3_navigation2/launch/navigation2.launch.py
index 027a60b7..2e145568 100644
--- a/turtlebot3_navigation2/launch/navigation2.launch.py
+++ b/turtlebot3_navigation2/launch/navigation2.launch.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+#
# Author: Darby Lim
import os
@@ -26,6 +26,7 @@
TURTLEBOT3_MODEL = os.environ['TURTLEBOT3_MODEL']
+
def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
map_dir = LaunchConfiguration(
diff --git a/turtlebot3_navigation2/package.xml b/turtlebot3_navigation2/package.xml
index 5764cf77..342fb612 100644
--- a/turtlebot3_navigation2/package.xml
+++ b/turtlebot3_navigation2/package.xml
@@ -5,15 +5,14 @@
2.1.0
ROS 2 launch scripts for navigation2
-
- Apache 2.0
- Darby Lim
- Pyo
+
Will Son
- http://wiki.ros.org/turtlebot3_bringup
- http://turtlebot3.robotis.com
+ Apache 2.0
+ http://turtlebot3.robotis.com
https://github.com/ROBOTIS-GIT/turtlebot3
https://github.com/ROBOTIS-GIT/turtlebot3/issues
+ Darby Lim
+ Pyo
ament_cmake
nav2_bringup
diff --git a/turtlebot3_node/include/turtlebot3_node/control_table.hpp b/turtlebot3_node/include/turtlebot3_node/control_table.hpp
index 55130b83..35e7e42c 100644
--- a/turtlebot3_node/include/turtlebot3_node/control_table.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/control_table.hpp
@@ -1,23 +1,21 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_CONTROL_TABLE_HPP_
-#define TURTLEBOT3_NODE_CONTROL_TABLE_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__CONTROL_TABLE_HPP_
+#define TURTLEBOT3_NODE__CONTROL_TABLE_HPP_
#include
@@ -110,7 +108,7 @@ typedef struct
} ControlTable;
const ControlTable extern_control_table;
-} // turtlebot3
-} // robotis
+} // namespace turtlebot3
+} // namespace robotis
-#endif // TURTLEBOT3_NODE_CONTROL_TABLE_HPP_
+#endif // TURTLEBOT3_NODE__CONTROL_TABLE_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/devices/devices.hpp b/turtlebot3_node/include/turtlebot3_node/devices/devices.hpp
index 6161f9f5..3a675665 100644
--- a/turtlebot3_node/include/turtlebot3_node/devices/devices.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/devices/devices.hpp
@@ -1,30 +1,28 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__DEVICES__DEVICES_HPP_
+#define TURTLEBOT3_NODE__DEVICES__DEVICES_HPP_
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_DEVICES_DEVICES_HPP_
-#define TURTLEBOT3_NODE_DEVICES_DEVICES_HPP_
+#include
#include
#include
#include
-#include
-
#include "turtlebot3_node/control_table.hpp"
#include "turtlebot3_node/dynamixel_sdk_wrapper.hpp"
@@ -35,8 +33,9 @@ namespace turtlebot3
extern const ControlTable extern_control_table;
namespace devices
{
-class Devices{
- public:
+class Devices
+{
+public:
explicit Devices(
std::shared_ptr & nh,
std::shared_ptr & dxl_sdk_wrapper)
@@ -47,12 +46,12 @@ class Devices{
virtual void command(const void * request, void * response) = 0;
- protected:
+protected:
std::shared_ptr nh_;
std::shared_ptr dxl_sdk_wrapper_;
rclcpp::QoS qos_ = rclcpp::QoS(rclcpp::ServicesQoS());
};
-} // devices
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DEVICES_DEVICES_HPP_
+} // namespace devices
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DEVICES__DEVICES_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/devices/motor_power.hpp b/turtlebot3_node/include/turtlebot3_node/devices/motor_power.hpp
index ab0b9af5..9c8159e9 100644
--- a/turtlebot3_node/include/turtlebot3_node/devices/motor_power.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/devices/motor_power.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_DEVICES_MOTOR_POWER_HPP_
-#define TURTLEBOT3_NODE_DEVICES_MOTOR_POWER_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__DEVICES__MOTOR_POWER_HPP_
+#define TURTLEBOT3_NODE__DEVICES__MOTOR_POWER_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/devices/devices.hpp"
namespace robotis
@@ -31,7 +32,7 @@ namespace devices
{
class MotorPower : public Devices
{
- public:
+public:
static void request(
rclcpp::Client::SharedPtr client,
std_srvs::srv::SetBool::Request req);
@@ -43,10 +44,10 @@ class MotorPower : public Devices
void command(const void * request, void * response) override;
- private:
+private:
rclcpp::Service::SharedPtr srv_;
};
-} // devices
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DEVICES_MOTOR_POWER_HPP_
+} // namespace devices
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DEVICES__MOTOR_POWER_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/devices/reset.hpp b/turtlebot3_node/include/turtlebot3_node/devices/reset.hpp
index f83dc3a3..da6da70b 100644
--- a/turtlebot3_node/include/turtlebot3_node/devices/reset.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/devices/reset.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_DEVICES_RESET_HPP_
-#define TURTLEBOT3_NODE_DEVICES_RESET_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__DEVICES__RESET_HPP_
+#define TURTLEBOT3_NODE__DEVICES__RESET_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/devices/devices.hpp"
namespace robotis
@@ -31,7 +32,7 @@ namespace devices
{
class Reset : public Devices
{
- public:
+public:
static void request(
rclcpp::Client::SharedPtr client,
std_srvs::srv::Trigger::Request req);
@@ -43,10 +44,10 @@ class Reset : public Devices
void command(const void * request, void * response) override;
- private:
+private:
rclcpp::Service::SharedPtr srv_;
};
-} // devices
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DEVICES_SOUND_HPP_
+} // namespace devices
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DEVICES__RESET_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/devices/sound.hpp b/turtlebot3_node/include/turtlebot3_node/devices/sound.hpp
index 6fc8a73d..99dcdd2b 100644
--- a/turtlebot3_node/include/turtlebot3_node/devices/sound.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/devices/sound.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_DEVICES_SOUND_HPP_
-#define TURTLEBOT3_NODE_DEVICES_SOUND_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__DEVICES__SOUND_HPP_
+#define TURTLEBOT3_NODE__DEVICES__SOUND_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/devices/devices.hpp"
namespace robotis
@@ -31,7 +32,7 @@ namespace devices
{
class Sound : public Devices
{
- public:
+public:
static void request(
rclcpp::Client::SharedPtr client,
turtlebot3_msgs::srv::Sound::Request req);
@@ -43,10 +44,10 @@ class Sound : public Devices
void command(const void * request, void * response) override;
- private:
+private:
rclcpp::Service::SharedPtr srv_;
};
-} // devices
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DEVICES_SOUND_HPP_
+} // namespace devices
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DEVICES__SOUND_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/diff_drive_controller.hpp b/turtlebot3_node/include/turtlebot3_node/diff_drive_controller.hpp
index 0a7e89d4..9fe23bb1 100644
--- a/turtlebot3_node/include/turtlebot3_node/diff_drive_controller.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/diff_drive_controller.hpp
@@ -1,28 +1,26 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
-/* Author: Darby Lim */
+#ifndef TURTLEBOT3_NODE__DIFF_DRIVE_CONTROLLER_HPP_
+#define TURTLEBOT3_NODE__DIFF_DRIVE_CONTROLLER_HPP_
-#ifndef TURTLEBOT3_NODE_DIFF_DRIVE_CONTROLLER_HPP_
-#define TURTLEBOT3_NODE_DIFF_DRIVE_CONTROLLER_HPP_
+#include
#include
-#include
-
#include "turtlebot3_node/odometry.hpp"
namespace robotis
@@ -31,14 +29,14 @@ namespace turtlebot3
{
class DiffDriveController : public rclcpp::Node
{
- public:
+public:
explicit DiffDriveController(const float wheel_seperation, const float wheel_radius);
- virtual ~DiffDriveController(){};
+ virtual ~DiffDriveController() {}
- private:
+private:
std::shared_ptr nh_;
std::unique_ptr odometry_;
};
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DIFF_DRIVE_CONTROLLER_HPP_
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DIFF_DRIVE_CONTROLLER_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/dynamixel_sdk_wrapper.hpp b/turtlebot3_node/include/turtlebot3_node/dynamixel_sdk_wrapper.hpp
index 414705af..87e2bc6f 100644
--- a/turtlebot3_node/include/turtlebot3_node/dynamixel_sdk_wrapper.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/dynamixel_sdk_wrapper.hpp
@@ -1,23 +1,24 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_DYNAMIXEL_SDK_WRAPPER_HPP_
-#define TURTLEBOT3_NODE_DYNAMIXEL_SDK_WRAPPER_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
+#define TURTLEBOT3_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
+
+#include
+#include
#include
#include
@@ -29,9 +30,6 @@
#include
#include
-#include
-#include
-
#define LOG_INFO RCUTILS_LOG_INFO_NAMED
#define LOG_WARN RCUTILS_LOG_WARN_NAMED
#define LOG_ERROR RCUTILS_LOG_ERROR_NAMED
@@ -47,7 +45,7 @@ namespace turtlebot3
class DynamixelSDKWrapper
{
- public:
+public:
typedef struct
{
std::string usb_port;
@@ -59,35 +57,34 @@ class DynamixelSDKWrapper
explicit DynamixelSDKWrapper(const Device & device);
virtual ~DynamixelSDKWrapper();
- template
+ template
DataByteT get_data_from_device(const uint16_t & addr, const uint16_t & length)
{
DataByteT data = 0;
- uint8_t * p_data = (uint8_t*)&data;
+ uint8_t * p_data = reinterpret_cast(&data);
uint16_t index = addr - read_memory_.start_addr;
std::lock_guard lock(read_data_mutex_);
- switch (length)
- {
+ switch (length) {
case 1:
- p_data[0] = read_memory_.data[index+0];
+ p_data[0] = read_memory_.data[index + 0];
break;
case 2:
- p_data[0] = read_memory_.data[index+0];
- p_data[1] = read_memory_.data[index+1];
+ p_data[0] = read_memory_.data[index + 0];
+ p_data[1] = read_memory_.data[index + 1];
break;
case 4:
- p_data[0] = read_memory_.data[index+0];
- p_data[1] = read_memory_.data[index+1];
- p_data[2] = read_memory_.data[index+2];
- p_data[3] = read_memory_.data[index+3];
+ p_data[0] = read_memory_.data[index + 0];
+ p_data[1] = read_memory_.data[index + 1];
+ p_data[2] = read_memory_.data[index + 2];
+ p_data[3] = read_memory_.data[index + 3];
break;
default:
- p_data[0] = read_memory_.data[index+0];
- break;
+ p_data[0] = read_memory_.data[index + 0];
+ break;
}
return data;
@@ -104,7 +101,7 @@ class DynamixelSDKWrapper
bool is_connected_to_device();
- private:
+private:
bool init_dynamixel_sdk_handlers();
bool read_register(
@@ -142,6 +139,6 @@ class DynamixelSDKWrapper
std::mutex read_data_mutex_;
std::mutex write_data_mutex_;
};
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_DYNAMIXEL_SDK_WRAPPER_HPP_
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/odometry.hpp b/turtlebot3_node/include/turtlebot3_node/odometry.hpp
index 1c580d95..1ed7cfd5 100644
--- a/turtlebot3_node/include/turtlebot3_node/odometry.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/odometry.hpp
@@ -1,27 +1,21 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_ODOMETRY_HPP_
-#define TURTLEBOT3_NODE_ODOMETRY_HPP_
-
-#include
-#include
-#include
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__ODOMETRY_HPP_
+#define TURTLEBOT3_NODE__ODOMETRY_HPP_
#include
#include
@@ -34,20 +28,25 @@
#include
#include
+#include
+#include
+#include
+#include
+
namespace robotis
{
namespace turtlebot3
{
class Odometry
{
- public:
+public:
explicit Odometry(
std::shared_ptr & nh,
const double wheels_separation,
const double wheels_radius);
- virtual ~Odometry(){};
+ virtual ~Odometry() {}
- private:
+private:
bool calculate_odometry(const rclcpp::Duration & duration);
void update_imu(const std::shared_ptr & imu);
@@ -72,8 +71,8 @@ class Odometry
std::shared_ptr> msg_ftr_imu_sub_;
typedef message_filters::sync_policies::ApproximateTime<
- sensor_msgs::msg::JointState,
- sensor_msgs::msg::Imu> SyncPolicyJointStateImu;
+ sensor_msgs::msg::JointState,
+ sensor_msgs::msg::Imu> SyncPolicyJointStateImu;
typedef message_filters::Synchronizer SynchronizerJointStateImu;
std::shared_ptr joint_state_imu_sync_;
@@ -90,9 +89,9 @@ class Odometry
std::array diff_joint_positions_;
double imu_angle_;
- std::array robot_pose_;
- std::array robot_vel_;
+ std::array robot_pose_;
+ std::array robot_vel_;
};
-} // turtlebot3
-} // robotis
-#endif //TURTLEBOT3_NODE_ODOMETRY_HPP_
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__ODOMETRY_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/sensors/battery_state.hpp b/turtlebot3_node/include/turtlebot3_node/sensors/battery_state.hpp
index 88090898..31eaa824 100644
--- a/turtlebot3_node/include/turtlebot3_node/sensors/battery_state.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/sensors/battery_state.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_SENSORS_BATTERY_STATE_HPP_
-#define TURTLEBOT3_NODE_SENSORS_BATTERY_STATE_HPP_
+#ifndef TURTLEBOT3_NODE__SENSORS__BATTERY_STATE_HPP_
+#define TURTLEBOT3_NODE__SENSORS__BATTERY_STATE_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/sensors/sensors.hpp"
namespace robotis
@@ -31,7 +32,7 @@ namespace sensors
{
class BatteryState : public Sensors
{
- public:
+public:
explicit BatteryState(
std::shared_ptr & nh,
const std::string & topic_name = "battery_state");
@@ -40,10 +41,10 @@ class BatteryState : public Sensors
const rclcpp::Time & now,
std::shared_ptr & dxl_sdk_wrapper) override;
- private:
+private:
rclcpp::Publisher::SharedPtr pub_;
};
-} // sensors
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_SENSORS_BATTERY_STATE_HPP_
+} // namespace sensors
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__SENSORS__BATTERY_STATE_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/sensors/imu.hpp b/turtlebot3_node/include/turtlebot3_node/sensors/imu.hpp
index a2c7d2ae..e0f988fb 100644
--- a/turtlebot3_node/include/turtlebot3_node/sensors/imu.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/sensors/imu.hpp
@@ -1,27 +1,28 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_SENSORS_IMU_HPP_
-#define TURTLEBOT3_NODE_SENSORS_IMU_HPP_
+#ifndef TURTLEBOT3_NODE__SENSORS__IMU_HPP_
+#define TURTLEBOT3_NODE__SENSORS__IMU_HPP_
#include
#include
+#include
+#include
+
#include "turtlebot3_node/sensors/sensors.hpp"
namespace robotis
@@ -32,7 +33,7 @@ namespace sensors
{
class Imu : public Sensors
{
- public:
+public:
explicit Imu(
std::shared_ptr & nh,
const std::string & imu_topic_name = "imu",
@@ -43,11 +44,11 @@ class Imu : public Sensors
const rclcpp::Time & now,
std::shared_ptr & dxl_sdk_wrapper) override;
- private:
+private:
rclcpp::Publisher::SharedPtr imu_pub_;
rclcpp::Publisher::SharedPtr mag_pub_;
};
-} // sensors
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_SENSORS_IMU_HPP_
+} // namespace sensors
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__SENSORS__IMU_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/sensors/joint_state.hpp b/turtlebot3_node/include/turtlebot3_node/sensors/joint_state.hpp
index a3a2c03c..a465d671 100644
--- a/turtlebot3_node/include/turtlebot3_node/sensors/joint_state.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/sensors/joint_state.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_SENSORS_JOINT_STATE_HPP_
-#define TURTLEBOT3_NODE_SENSORS_JOINT_STATE_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__SENSORS__JOINT_STATE_HPP_
+#define TURTLEBOT3_NODE__SENSORS__JOINT_STATE_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/sensors/sensors.hpp"
namespace robotis
@@ -39,7 +40,7 @@ constexpr double TICK_TO_RAD = 0.001533981;
class JointState : public Sensors
{
- public:
+public:
explicit JointState(
std::shared_ptr & nh,
const std::string & topic_name = "joint_states",
@@ -49,10 +50,10 @@ class JointState : public Sensors
const rclcpp::Time & now,
std::shared_ptr & dxl_sdk_wrapper) override;
- private:
+private:
rclcpp::Publisher::SharedPtr pub_;
};
-} // sensors
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_SENSORS_JOINT_STATE_HPP_
+} // namespace sensors
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__SENSORS__JOINT_STATE_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/sensors/sensor_state.hpp b/turtlebot3_node/include/turtlebot3_node/sensors/sensor_state.hpp
index 229e9306..30b114f2 100644
--- a/turtlebot3_node/include/turtlebot3_node/sensors/sensor_state.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/sensors/sensor_state.hpp
@@ -1,26 +1,27 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_SENSORS_SENSOR_STATE_HPP_
-#define TURTLEBOT3_NODE_SENSORS_SENSOR_STATE_HPP_
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__SENSORS__SENSOR_STATE_HPP_
+#define TURTLEBOT3_NODE__SENSORS__SENSOR_STATE_HPP_
#include
+#include
+#include
+
#include "turtlebot3_node/sensors/sensors.hpp"
namespace robotis
@@ -31,7 +32,7 @@ namespace sensors
{
class SensorState : public Sensors
{
- public:
+public:
explicit SensorState(
std::shared_ptr & nh,
const std::string & topic_name = "sensor_state",
@@ -45,7 +46,7 @@ class SensorState : public Sensors
const rclcpp::Time & now,
std::shared_ptr & dxl_sdk_wrapper) override;
- private:
+private:
rclcpp::Publisher::SharedPtr pub_;
bool bumper_forward_;
@@ -54,7 +55,7 @@ class SensorState : public Sensors
bool sonar_;
bool illumination_;
};
-} // sensors
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_SENSORS_SENSOR_STATE_HPP_
+} // namespace sensors
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__SENSORS__SENSOR_STATE_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/sensors/sensors.hpp b/turtlebot3_node/include/turtlebot3_node/sensors/sensors.hpp
index d1bd9c4d..c90faead 100644
--- a/turtlebot3_node/include/turtlebot3_node/sensors/sensors.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/sensors/sensors.hpp
@@ -1,30 +1,28 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__SENSORS__SENSORS_HPP_
+#define TURTLEBOT3_NODE__SENSORS__SENSORS_HPP_
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_SENSORS_SENSORS_HPP_
-#define TURTLEBOT3_NODE_SENSORS_SENSORS_HPP_
+#include
#include
#include
#include
-#include
-
#include "turtlebot3_node/control_table.hpp"
#include "turtlebot3_node/dynamixel_sdk_wrapper.hpp"
@@ -37,7 +35,7 @@ namespace sensors
{
class Sensors
{
- public:
+public:
explicit Sensors(
std::shared_ptr & nh,
const std::string & frame_id = "")
@@ -50,12 +48,12 @@ class Sensors
const rclcpp::Time & now,
std::shared_ptr & dxl_sdk_wrapper) = 0;
- protected:
+protected:
std::shared_ptr nh_;
std::string frame_id_;
rclcpp::QoS qos_ = rclcpp::QoS(rclcpp::KeepLast(10));
};
-} // sensors
-} // turtlebot3
-} // robotis
-#endif // TURTLEBOT3_NODE_SENSORS_SENSORS_HPP_
+} // namespace sensors
+} // namespace turtlebot3
+} // namespace robotis
+#endif // TURTLEBOT3_NODE__SENSORS__SENSORS_HPP_
diff --git a/turtlebot3_node/include/turtlebot3_node/turtlebot3.hpp b/turtlebot3_node/include/turtlebot3_node/turtlebot3.hpp
index efefafb3..38ece2ea 100644
--- a/turtlebot3_node/include/turtlebot3_node/turtlebot3.hpp
+++ b/turtlebot3_node/include/turtlebot3_node/turtlebot3.hpp
@@ -1,31 +1,21 @@
-/*******************************************************************************
-* Copyright 2019 ROBOTIS CO., LTD.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*******************************************************************************/
-
-/* Author: Darby Lim */
-
-#ifndef TURTLEBOT3_NODE_TURTLEBOT3_HPP_
-#define TURTLEBOT3_NODE_TURTLEBOT3_HPP_
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+// Copyright 2019 ROBOTIS CO., LTD.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Darby Lim
+
+#ifndef TURTLEBOT3_NODE__TURTLEBOT3_HPP_
+#define TURTLEBOT3_NODE__TURTLEBOT3_HPP_
#include
#include
@@ -36,6 +26,15 @@
#include
#include
+#include
+#include
+#include
+#include