Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit 5fe0d68

Browse files
committed
Merge branch 'master' into dev/protobuf-package
2 parents 50f98bd + 8b39c49 commit 5fe0d68

6 files changed

Lines changed: 167 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(consai2r2_description)
3+
4+
# Default to C++14
5+
if(NOT CMAKE_CXX_STANDARD)
6+
set(CMAKE_CXX_STANDARD 14)
7+
endif()
8+
9+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
endif()
12+
13+
# find dependencies
14+
find_package(ament_cmake REQUIRED)
15+
find_package(rclcpp REQUIRED)
16+
17+
include_directories(include ${CMAKE_CURRENT_BINARY_DIR})
18+
add_executable(${PROJECT_NAME}_node
19+
src/${PROJECT_NAME}_node.cpp
20+
)
21+
ament_target_dependencies(
22+
${PROJECT_NAME}_node
23+
"rclcpp"
24+
"launch_ros"
25+
)
26+
27+
28+
install(TARGETS ${PROJECT_NAME}_node
29+
EXPORT export_${PROJECT_NAME}
30+
DESTINATION lib/${PROJECT_NAME})
31+
32+
install(DIRECTORY
33+
launch
34+
DESTINATION share/${PROJECT_NAME}/
35+
)
36+
37+
install(DIRECTORY
38+
config
39+
DESTINATION share/${PROJECT_NAME}/
40+
)
41+
42+
43+
44+
if(BUILD_TESTING)
45+
find_package(ament_lint_auto REQUIRED)
46+
# the following line skips the linter which checks for copyrights
47+
# uncomment the line when a copyright and license is not present in all source files
48+
#set(ament_cmake_copyright_FOUND TRUE)
49+
# the following line skips cpplint (only works in a git repo)
50+
# uncomment the line when this package is not in a git repo
51+
#set(ament_cmake_cpplint_FOUND TRUE)
52+
ament_lint_auto_find_test_dependencies()
53+
endif()
54+
55+
ament_package()

consai2r2_description/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# consai2r2_description
2+
共通パラメータを提供する
3+
## 起動方法
4+
~~~bash
5+
ros2 launch consai2r2_description config.launch.py
6+
~~~
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
consai2r2_description:
2+
ros__parameters:
3+
max_id: 15
4+
our_side: 'left'
5+
our_color: 'blue'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) 2019 SSL-Roots
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
# THE SOFTWARE.
20+
21+
import os
22+
23+
from launch import LaunchDescription
24+
from launch_ros.actions import Node
25+
from ament_index_python.packages import get_package_share_directory
26+
27+
28+
def generate_launch_description():
29+
config_path = os.path.join(
30+
get_package_share_directory('consai2r2_description'), 'config', 'config.yaml')
31+
32+
return LaunchDescription([
33+
Node(
34+
package='consai2r2_description', node_executable='consai2r2_description_node',
35+
output='screen', parameters=[config_path])
36+
])

consai2r2_description/package.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>consai2r2_description</name>
5+
<version>0.0.0</version>
6+
<description>TODO: Package description</description>
7+
<maintainer email="macakasit@gmail.com">akshota</maintainer>
8+
<license>MIT</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<depend>rclcpp</depend>
13+
<depend>launch_ros</depend>
14+
15+
<test_depend>ament_lint_auto</test_depend>
16+
<test_depend>ament_lint_common</test_depend>
17+
18+
<export>
19+
<build_type>ament_cmake</build_type>
20+
</export>
21+
</package>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2019 SSL-Roots
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
21+
#include <memory>
22+
#include "rclcpp/rclcpp.hpp"
23+
24+
class DescriptionNode : public rclcpp::Node
25+
{
26+
public:
27+
DescriptionNode()
28+
: Node("consai2r2_description")
29+
{
30+
this->declare_parameter("max_id");
31+
this->declare_parameter("our_side");
32+
this->declare_parameter("our_color");
33+
}
34+
35+
private:
36+
};
37+
38+
int main(int argc, char * argv[])
39+
{
40+
rclcpp::init(argc, argv);
41+
rclcpp::spin(std::make_shared<DescriptionNode>());
42+
rclcpp::shutdown();
43+
return 0;
44+
}

0 commit comments

Comments
 (0)