-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from robotpilot/develop
Bump to 0.3.0
- Loading branch information
Showing
36 changed files
with
565 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>my_first_ros_rclcpp_pkg</name> | ||
<version>0.2.0</version> | ||
<version>0.3.0</version> | ||
<description>ROS 2 rclcpp basic package for the ROS 2 seminar</description> | ||
<maintainer email="[email protected]">Pyo</maintainer> | ||
<license>Apache License 2.0</license> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>my_first_ros_rclpy_pkg</name> | ||
<version>0.2.0</version> | ||
<version>0.3.0</version> | ||
<description>ROS 2 rclpy basic package for the ROS 2 seminar</description> | ||
<maintainer email="[email protected]">Pyo</maintainer> | ||
<license>Apache License 2.0</license> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Changelog for package ros2env | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
0.3.0 (2021-01-28) | ||
------------------ | ||
* Added ros2cli command and verbs for example of roc2cli | ||
* Contributors: Pyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>ros2env</name> | ||
<version>0.3.0</version> | ||
<description>ROS 2 example package for the ROS 2 command line tools.</description> | ||
<maintainer email="[email protected]">Pyo</maintainer> | ||
<license>Apache License 2.0</license> | ||
<author email="[email protected]">Jeremie Deray</author> | ||
<author email="[email protected]">Pyo</author> | ||
<author email="[email protected]">Darby Lim</author> | ||
<depend>ros2cli</depend> | ||
<test_depend>ament_copyright</test_depend> | ||
<test_depend>ament_flake8</test_depend> | ||
<test_depend>ament_pep257</test_depend> | ||
<test_depend>ament_xmllint</test_depend> | ||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2018 Open Source Robotics Foundation, Inc. | ||
# Copyright 2019 Canonical Ldt. | ||
# Copyright 2021 OROCA | ||
# | ||
# 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. | ||
|
||
import os | ||
|
||
|
||
def get_ros_env_list(): | ||
ros_version = os.getenv('ROS_VERSION', 'None') | ||
ros_distro = os.getenv('ROS_DISTRO', 'None') | ||
ros_python_version = os.getenv('ROS_PYTHON_VERSION', 'None') | ||
ros_env_list = 'ROS_VERSION = {0}\n\ | ||
ROS_DISTRO = {1}\n\ | ||
ROS_PYTHON_VERSION = {2}\n'.format(ros_version, ros_distro, ros_python_version) | ||
return ros_env_list | ||
|
||
|
||
def get_dds_env_list(): | ||
ros_domain_id = os.getenv('ROS_DOMAIN_ID', 'None') | ||
rmw_implementation = os.getenv('RMW_IMPLEMENTATION', 'None') | ||
dds_env_list = 'ROS_DOMAIN_ID = {0}\n\ | ||
RMW_IMPLEMENTATION = {1}\n'.format(ros_domain_id, rmw_implementation) | ||
return dds_env_list | ||
|
||
|
||
def get_all_env_list(): | ||
ros_env_list = get_ros_env_list() | ||
dds_env_list = get_dds_env_list() | ||
all_env_list = ros_env_list + dds_env_list | ||
return all_env_list | ||
|
||
|
||
def set_ros_env(env_name, env_value): | ||
os.environ[env_name] = env_value | ||
value = os.getenv(env_name, 'None') | ||
return '{0} = {1}'.format(env_name, value) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2018 Open Source Robotics Foundation, Inc. | ||
# Copyright 2019 Canonical Ldt. | ||
# Copyright 2021 OROCA | ||
# | ||
# 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. | ||
|
||
from ros2cli.command import add_subparsers_on_demand | ||
from ros2cli.command import CommandExtension | ||
|
||
|
||
class EnvCommand(CommandExtension): | ||
"""Various env related sub-commands.""" | ||
|
||
def add_arguments(self, parser, cli_name): | ||
self._subparser = parser | ||
|
||
# add arguments and sub-commands of verbs | ||
add_subparsers_on_demand( | ||
parser, cli_name, '_verb', 'ros2env.verb', required=False) | ||
|
||
def main(self, *, parser, args): | ||
if not hasattr(args, '_verb'): | ||
# in case no verb was passed | ||
self._subparser.print_help() | ||
return 0 | ||
|
||
extension = getattr(args, '_verb') | ||
|
||
# call the verb's main method | ||
return extension.main(args=args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2018 Open Source Robotics Foundation, Inc. | ||
# | ||
# 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. | ||
|
||
from ros2cli.plugin_system import PLUGIN_SYSTEM_VERSION | ||
from ros2cli.plugin_system import satisfies_version | ||
|
||
|
||
class VerbExtension: | ||
""" | ||
The extension point for 'env' verb extensions. | ||
The following properties must be defined: | ||
* `NAME` (will be set to the entry point name) | ||
The following methods must be defined: | ||
* `main` | ||
The following methods can be defined: | ||
* `add_arguments` | ||
""" | ||
|
||
NAME = None | ||
EXTENSION_POINT_VERSION = '0.1' | ||
|
||
def __init__(self): | ||
super(VerbExtension, self).__init__() | ||
satisfies_version(PLUGIN_SYSTEM_VERSION, '^0.1') | ||
|
||
def add_arguments(self, parser, cli_name): | ||
pass | ||
|
||
def main(self, *, args): | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2018 Open Source Robotics Foundation, Inc. | ||
# Copyright 2019 Canonical Ldt. | ||
# Copyright 2021 OROCA | ||
# | ||
# 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. | ||
|
||
from ros2env.api import get_all_env_list | ||
from ros2env.api import get_dds_env_list | ||
from ros2env.api import get_ros_env_list | ||
from ros2env.verb import VerbExtension | ||
|
||
|
||
class ListVerb(VerbExtension): | ||
"""Output a list of ROS environment variables.""" | ||
|
||
def add_arguments(self, parser, cli_name): | ||
parser.add_argument( | ||
'-a', '--all', action='store_true', | ||
help='Display all environment variables.') | ||
parser.add_argument( | ||
'-r', '--ros-env', action='store_true', | ||
help='Display the ROS environment variables.') | ||
parser.add_argument( | ||
'-d', '--dds-env', action='store_true', | ||
help='Display the DDS environment variables.') | ||
|
||
def main(self, *, args): | ||
if args.ros_env: | ||
message = get_ros_env_list() | ||
elif args.dds_env: | ||
message = get_dds_env_list() | ||
else: | ||
message = get_all_env_list() | ||
print(message) |
Oops, something went wrong.