Skip to content

Commit c7e8e06

Browse files
tkimura4isamu-takagikenji-miyakeh-ohta1222-takeshi
authored
feat: add autoware_version package (#11)
* Add autoware version node (autowarefoundation#394) * Add autoware version node Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Remove todo Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Remove unused variable Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix node name Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Modify autoware_version not to use transient_local (workaround) (autowarefoundation#403) * Modify autoware_version not to use transient_local Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Add todo comment Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix for lint Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Revert "Modify autoware_version not to use transient_local (workaround) (autowarefoundation#403)" (autowarefoundation#418) This reverts commit 39b7ef232a3d21c619d28935fa122abf23891961. Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix -Wunused-parameter (autowarefoundation#1836) * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix spell * Fix lint issues Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore flake8 warnings Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> * Add package version API (autowarefoundation#2150) * Add package version API * Fix format * Fix message type * Change formatter to clang-format and black (autowarefoundation#2332) * Revert "Temporarily comment out pre-commit hooks" This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3. * Replace ament_lint_common with autoware_lint_common Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove ament_cmake_uncrustify and ament_clang_format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply Black Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix for cpplint * Fix include double quotes to angle brackets Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add COLCON_IGNORE (autowarefoundation#500) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * remove COLCON_IGNORE in autoware_version (autowarefoundation#530) * Add readme of autoware_version (autowarefoundation#612) * change type * add readme * ci(pre-commit): autofix Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f3a26bc commit c7e8e06

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(autoware_version)
3+
4+
find_package(ament_cmake_auto REQUIRED)
5+
ament_auto_find_build_dependencies()
6+
7+
install(PROGRAMS
8+
script/print
9+
DESTINATION lib/${PROJECT_NAME}
10+
)
11+
12+
if(BUILD_TESTING)
13+
find_package(ament_lint_auto REQUIRED)
14+
ament_lint_auto_find_test_dependencies()
15+
endif()
16+
17+
ament_auto_package()

system/autoware_version/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# autoware_version
2+
3+
This package provides a command line tool to know the architecture version. This feature is temporary and will be removed when the interface is unified in the future.
4+
5+
## How to use
6+
7+
```sh
8+
ros2 run autoware_version print arch {full,type,version}
9+
```

system/autoware_version/package.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
5+
<name>autoware_version</name>
6+
<version>0.0.0</version>
7+
<description>The autoware_version package</description>
8+
<maintainer email="isamu.takagi@tier4.jp">Takagi, Isamu</maintainer>
9+
<license>Apache License 2.0</license>
10+
11+
<buildtool_depend>ament_cmake_auto</buildtool_depend>
12+
13+
<test_depend>ament_lint_auto</test_depend>
14+
<test_depend>autoware_lint_common</test_depend>
15+
16+
<export>
17+
<build_type>ament_cmake</build_type>
18+
</export>
19+
20+
</package>

system/autoware_version/script/print

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python3
2+
# TODO(Takagi, Isamu): this is a temporary script and may change in the future
3+
import argparse
4+
5+
parser = argparse.ArgumentParser()
6+
parser.add_argument("target", choices=["arch"])
7+
parser.add_argument("format", choices=["full", "type", "version"], default="full", nargs="?")
8+
args = parser.parse_args()
9+
data = {"arch": {"type": "universe", "version": "1.0.0"}}
10+
11+
if args.format == "full":
12+
print("{type} {version}".format(**data[args.target]))
13+
else:
14+
print(data[args.target][args.format])

0 commit comments

Comments
 (0)