Skip to content

Commit

Permalink
feat: add autoware_version package (#11)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
6 people authored Dec 5, 2021
1 parent f3a26bc commit c7e8e06
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
17 changes: 17 additions & 0 deletions system/autoware_version/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_version)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

install(PROGRAMS
script/print
DESTINATION lib/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package()
9 changes: 9 additions & 0 deletions system/autoware_version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# autoware_version

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.

## How to use

```sh
ros2 run autoware_version print arch {full,type,version}
```
20 changes: 20 additions & 0 deletions system/autoware_version/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">

<name>autoware_version</name>
<version>0.0.0</version>
<description>The autoware_version package</description>
<maintainer email="isamu.takagi@tier4.jp">Takagi, Isamu</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
14 changes: 14 additions & 0 deletions system/autoware_version/script/print
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
# TODO(Takagi, Isamu): this is a temporary script and may change in the future
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("target", choices=["arch"])
parser.add_argument("format", choices=["full", "type", "version"], default="full", nargs="?")
args = parser.parse_args()
data = {"arch": {"type": "universe", "version": "1.0.0"}}

if args.format == "full":
print("{type} {version}".format(**data[args.target]))
else:
print(data[args.target][args.format])

0 comments on commit c7e8e06

Please sign in to comment.