Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Namespace Support #189

Draft
wants to merge 44 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4e060c5
set ign_ros2_control minimum version
alsora Mar 31, 2022
3e98b7e
remove minimum version requirement
alsora May 5, 2022
a291e51
update changelog
alsora May 5, 2022
ebfc5a4
1.0.2
alsora May 5, 2022
5b65541
update changelog
alsora May 5, 2022
88458bd
1.0.3
alsora May 5, 2022
69030ef
remove ignition-ros2-control from dependencies.repos this is now avai…
alsora Apr 8, 2022
0327e8b
remove dependencies.repos file now that irobot_create_msgs has been r…
alsora Jun 20, 2022
55b7c39
WIP multi-robot simulation
hugo-tardiou Apr 13, 2022
64d4fac
nav2 dependency, lint and rebase
Jul 13, 2022
4ae8550
working two robot velocity cmd with cmd_vel_unstamped
Jul 29, 2022
c33245f
cmd_vel working for both no namespace, namespace and multi-robot name…
Aug 3, 2022
632c882
fixing frame prefixing and odom topic
Aug 5, 2022
9507e1d
17/08/2022
Aug 17, 2022
164b16f
clean up
Aug 18, 2022
2ca8428
fixing namespaced parameters following wildcard implementation in rclcpp
Aug 25, 2022
3418f97
commit 2 of fixing namespaced parameters following wildcard implement…
Aug 25, 2022
08ac8d4
control config file fix
Aug 26, 2022
3dfcf82
removing useless namespace options
hoang-david-ha Aug 30, 2022
1b9d321
fixing cmd_vel typo
Aug 31, 2022
9394b89
adding an empty world for low GPU machines
sp-sophia-labs Sep 1, 2022
edcbeea
fixing ir_intensity double namespacing
sp-sophia-labs Sep 2, 2022
d579b85
remove duplicated code and move namespacing to config files
sp-sophia-labs Sep 2, 2022
6e60d56
-internal namespacing WIP
sp-sophia-labs Sep 2, 2022
2a3bb3f
hotfix bumper_contact namespacing
sp-sophia-labs Sep 2, 2022
24bc1d2
small cleanup all topic are namespaced correctly
sp-sophia-labs Sep 7, 2022
592bbf1
fix bridge between /model/standard_dock/pose and _internal/sim_ground…
sp-sophia-labs Sep 21, 2022
a602cf3
fix sim_ground_truth_dock_pose republishing
sp-sophia-labs Sep 21, 2022
a5a58bd
fix is_docked and cleanup buttons topics
sp-sophia-labs Sep 26, 2022
86b15f9
remove problematic light from empty world
sp-sophia-labs Oct 10, 2022
c4c038d
textinput for create3 buttons
sp-sophia-labs Oct 10, 2022
1b3fba2
create3 ign gui topic selection
Oct 11, 2022
b04e182
default HMi topic to /buttons and fix ignition bridge accordingly
Oct 11, 2022
113593d
cleanup unsused imports
Oct 12, 2022
e0d225c
change namespace to robot name in button topic naming
sp-sophia-labs Oct 14, 2022
f0ffe71
small cleanup & added yaw argument to spawn_robot
sp-sophia-labs Oct 17, 2022
c198329
fix bumper contact bridge namespacing
Oct 21, 2022
916ada6
rebase on galactic and lint test passing
sp-sophia-labs Nov 3, 2022
229a2d5
reverting some rebase changes on non-code files
sp-sophia-labs Nov 4, 2022
308840e
removing useless changes to cleanup PR
sp-sophia-labs Nov 4, 2022
ca0236d
fixing import order for flake8 testing
sp-sophia-labs Nov 4, 2022
f3aa5e9
remapping /tf to tf
Dec 5, 2022
9a03954
removing useless changes
Dec 5, 2022
fa3e8d9
re-add tf remapping in create3 xacro files for proper namespacing
sp-sophia-labs Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Required dependencies:
2. ROS 2 dev tools:
- [colcon-common-extensions](https://pypi.org/project/colcon-common-extensions/)
- [rosdep](https://pypi.org/project/rosdep/): Used to install dependencies when building from sources
- [vcs](https://pypi.org/project/vcstool/): Automates cloning of git repositories declared on a YAML file.
- [vcs](https://pypi.org/project/vcstool/): Automates cloning of git repositories declared on a YAML file

Besides the aforementioned dependencies you will also need at least one among Ignition Gazebo and Classic Gazebo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

install(
DIRECTORY
Expand All @@ -21,6 +22,9 @@ install(
share/${PROJECT_NAME}
)

# Install Python modules
ament_python_install_package(${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
hazards_vector_publisher:
ros__parameters:
# Hazard detection publisher topic
publisher_topic: /hazard_detection
publish_rate: 62.0
subscription_topics:
# Bumper topic
- _internal/bumper/event
# Cliff topics
- _internal/cliff_front_left/event
- _internal/cliff_front_right/event
- _internal/cliff_side_left/event
- _internal/cliff_side_right/event
# Wheel drop topics
- _internal/wheel_drop/left_wheel/event
- _internal/wheel_drop/right_wheel/event
# Backup limit topic
- _internal/backup_limit
/**:
hazards_vector_publisher:
ros__parameters:
# Hazard detection publisher topic
publisher_topic: hazard_detection
publish_rate: 62.0
subscription_topics:
# Bumper topic
- _internal/bumper/event
# Cliff topics
- _internal/cliff_front_left/event
- _internal/cliff_front_right/event
- _internal/cliff_side_left/event
- _internal/cliff_side_right/event
# Wheel drop topics
- _internal/wheel_drop/left_wheel/event
- _internal/wheel_drop/right_wheel/event
# Backup limit topic
- _internal/backup_limit
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
ir_intensity_vector_publisher:
ros__parameters:
# IR intensity publisher topic
publisher_topic: /ir_intensity
publish_rate: 62.0
subscription_topics:
# IR intensity topics
- _internal/ir_intensity_front_center_left
- _internal/ir_intensity_front_center_right
- _internal/ir_intensity_front_left
- _internal/ir_intensity_front_right
- _internal/ir_intensity_left
- _internal/ir_intensity_right
- _internal/ir_intensity_side_left
/**:
ir_intensity_vector_publisher:
ros__parameters:
# IR intensity publisher topic
publisher_topic: ir_intensity
publish_rate: 62.0
subscription_topics:
# IR intensity topics
- _internal/ir_intensity_front_center_left
- _internal/ir_intensity_front_center_right
- _internal/ir_intensity_front_left
- _internal/ir_intensity_front_right
- _internal/ir_intensity_left
- _internal/ir_intensity_right
- _internal/ir_intensity_side_left
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
kidnap_estimator_publisher:
ros__parameters:
# Kidnap status publisher topic
kidnap_status_topic: /kidnap_status
# Subscription topics
hazard_topic: /hazard_detection
/**:
kidnap_estimator_publisher:
ros__parameters:
# Kidnap status publisher topic
kidnap_status_topic: kidnap_status
# Subscription topics
hazard_topic: hazard_detection
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
mock_publisher:
ros__parameters:
# Mock slip status publisher topic
slip_status_topic: /slip_status
# Publishers rate
slip_status_publish_rate: 62.0
/**:
mock_publisher:
ros__parameters:
# Mock slip status publisher topic
slip_status_topic: slip_status
# Publishers rate
slip_status_publish_rate: 62.0
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
robot_state:
ros__parameters:
# Stop status publisher topic
stop_status_topic: /stop_status
# Mock battery state publisher topic
battery_state_topic: /battery_state
# Publishers rate
kidnap_status_publish_rate: 1.0
stop_status_publish_rate: 62.0
battery_state_publish_rate: 0.1
# Subscription topics
dock_topic: /dock
wheel_vels_topic: /odom
# Stop status position difference tolerance
linear_velocity_tolerance: 0.01
angular_velocity_tolerance: 0.1
# Battery parameters
full_charge_percentage: 1.0
battery_high_percentage: 0.9
# Dock Parameters
undocked_charge_limit: 0.03
/**:
robot_state:
ros__parameters:
# Stop status publisher topic
stop_status_topic: stop_status
# Mock battery state publisher topic
battery_state_topic: battery_state
# Publishers rate
kidnap_status_publish_rate: 1.0
stop_status_publish_rate: 62.0
battery_state_publish_rate: 0.1
# Subscription topics
dock_topic: dock
wheel_vels_topic: odom
# Stop status position difference tolerance
linear_velocity_tolerance: 0.01
angular_velocity_tolerance: 0.1
# Battery parameters
full_charge_percentage: 1.0
battery_high_percentage: 0.9
# Dock Parameters
undocked_charge_limit: 0.03
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
ui_mgr:
ros__parameters:
# Buttons publisher topic
button_topic: /interface_buttons
# Publishers rate
buttons_publish_rate: 1.0
# Subscription topics
lightring_topic: /cmd_lightring
audio_topic: /cmd_audio
/**:
ui_mgr:
ros__parameters:
# Buttons publisher topic
button_topic: interface_buttons
# Publishers rate
buttons_publish_rate: 1.0
# Subscription topics
lightring_topic: cmd_lightring
audio_topic: cmd_audio
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
wheel_status_publisher:
ros__parameters:
# Publish rate
publish_rate: 62.0
# Encoder resolution
encoder_resolution: 508.8
# Wheel radius
wheel_radius: 0.03575
# Wheels angular velocity topic
velocity_topic: /wheel_vels
# Wheels' net encoder ticks topic
ticks_topic: /wheel_ticks
/**:
wheel_status_publisher:
ros__parameters:
# Publish rate
publish_rate: 62.0
# Encoder resolution
encoder_resolution: 508.8
# Wheel radius
wheel_radius: 0.03575
# Wheels angular velocity topic
velocity_topic: wheel_vels
# Wheels' net encoder ticks topic
ticks_topic: wheel_ticks
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from launch import LaunchContext, SomeSubstitutionsType, Substitution


class OffsetParser(Substitution):
def __init__(
self,
number: SomeSubstitutionsType,
offset: float,
) -> None:
self.__number = number
self.__offset = offset

def perform(
self,
context: LaunchContext = None,
) -> str:
number = float(self.__number.perform(context))
return f'{number + self.__offset}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# This file has been copied from https://github.com/ros-planning/navigation2
# for use as part of the iRobot Create 3 simulator.
#
# Copyright (c) 2019 Intel Corporation
#
# 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 tempfile
from typing import Dict
from typing import List
from typing import Text

import launch


class ReplaceString(launch.Substitution):
"""
Substitution that replaces strings on a given file.

Used in launch system
"""

def __init__(self,
source_file: launch.SomeSubstitutionsType,
replacements: Dict) -> None:
super().__init__()

# import here to avoid loop
from launch.utilities import normalize_to_list_of_substitutions
self.__source_file = normalize_to_list_of_substitutions(source_file)
self.__replacements = {}
for key in replacements:
self.__replacements[key] = normalize_to_list_of_substitutions(replacements[key])

@property
def name(self) -> List[launch.Substitution]:
"""Getter for name."""
return self.__source_file

def describe(self) -> Text:
"""Return a description of this substitution as a string."""
return ''

def perform(self, context: launch.LaunchContext) -> Text:
output_file = tempfile.NamedTemporaryFile(mode='w', delete=False)
replacements = self.resolve_replacements(context)
try:
input_file = open(launch.utilities.perform_substitutions(context, self.name), 'r')
self.replace(input_file, output_file, replacements)
except Exception as err: # noqa: B902
print('ReplaceString substitution error: ', err)
finally:
input_file.close()
output_file.close()
return output_file.name

def resolve_replacements(self, context):
resolved_replacements = {}
for key in self.__replacements:
resolved_replacements[key] = (launch.utilities.perform_substitutions
(context, self.__replacements[key]))
return resolved_replacements

def replace(self, input_file, output_file, replacements):
for line in input_file:
for key, value in replacements.items():
if isinstance(key, str) and isinstance(value, str):
if key in line:
line = line.replace(key, value)
else:
raise TypeError('A provided replacement pair is not a string.\
Both key and value should be strings.')
output_file.write(line)
Loading