From 2b00c9c9b9dde9da6a60fc3762b14da1905c4f4d Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Thu, 11 Jan 2024 18:11:58 +0100 Subject: [PATCH] test max 3 robots + env(NS) + readme --- README.md | 4 ++-- rosbot_bringup/config/ekf.yaml | 2 +- rosbot_bringup/launch/bringup.launch.py | 4 ++-- rosbot_bringup/test/test_multirobot_ekf.py | 2 +- rosbot_controller/test/test_multirobot_controllers.py | 2 +- rosbot_gazebo/launch/simulation.launch.py | 3 ++- rosbot_gazebo/test/test_multirobot_diff_drive_simulation.py | 2 +- rosbot_gazebo/test/test_multirobot_mecanum_simulation.py | 4 +--- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index daf3ab27..5ab328d1 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ rm -r src/rosbot_gazebo sudo rosdep init rosdep update --rosdistro $ROS_DISTRO rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y -colcon build +colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ``` > **Prerequisites** @@ -106,7 +106,7 @@ rm -rf src/gazebosim/gz_ros2_control/ign_ros2_control_demos src/gazebosim/gz_ros sudo rosdep init rosdep update --rosdistro $ROS_DISTRO rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y -colcon build +colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ``` Running: diff --git a/rosbot_bringup/config/ekf.yaml b/rosbot_bringup/config/ekf.yaml index c2d5a8f9..b8bb1672 100644 --- a/rosbot_bringup/config/ekf.yaml +++ b/rosbot_bringup/config/ekf.yaml @@ -3,7 +3,7 @@ ## ekf config file ### /**/ekf_filter_node: ros__parameters: - frequency: 25.0 + frequency: 20.0 sensor_timeout: 0.05 two_d_mode: true diff --git a/rosbot_bringup/launch/bringup.launch.py b/rosbot_bringup/launch/bringup.launch.py index dcf8eade..b77d3137 100644 --- a/rosbot_bringup/launch/bringup.launch.py +++ b/rosbot_bringup/launch/bringup.launch.py @@ -17,14 +17,14 @@ from ament_index_python.packages import get_package_share_directory from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution +from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution def generate_launch_description(): namespace = LaunchConfiguration("namespace") declare_namespace_arg = DeclareLaunchArgument( "namespace", - default_value="", + default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), description="Namespace for all topics and tfs", ) diff --git a/rosbot_bringup/test/test_multirobot_ekf.py b/rosbot_bringup/test/test_multirobot_ekf.py index 64a38731..57ae7a6c 100644 --- a/rosbot_bringup/test/test_multirobot_ekf.py +++ b/rosbot_bringup/test/test_multirobot_ekf.py @@ -25,7 +25,7 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource from test_utils import BringupTestNode -robot_names = ["rosbot1", "rosbot2", "rosbot3", "rosbot4"] +robot_names = ["robot1", "robot2", "robot3"] @launch_pytest.fixture diff --git a/rosbot_controller/test/test_multirobot_controllers.py b/rosbot_controller/test/test_multirobot_controllers.py index 8f067081..130956cf 100644 --- a/rosbot_controller/test/test_multirobot_controllers.py +++ b/rosbot_controller/test/test_multirobot_controllers.py @@ -25,7 +25,7 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource from test_utils import ControllersTestNode -robot_names = ["rosbot1", "rosbot2", "rosbot3", "rosbot4"] +robot_names = ["robot1", "robot2", "robot3"] @launch_pytest.fixture diff --git a/rosbot_gazebo/launch/simulation.launch.py b/rosbot_gazebo/launch/simulation.launch.py index c8706de6..962d9517 100644 --- a/rosbot_gazebo/launch/simulation.launch.py +++ b/rosbot_gazebo/launch/simulation.launch.py @@ -21,6 +21,7 @@ OpaqueFunction, ) from launch.substitutions import ( + EnvironmentVariable, PathJoinSubstitution, LaunchConfiguration, TextSubstitution, @@ -122,7 +123,7 @@ def launch_setup(context, *args, **kwargs): def generate_launch_description(): declare_namespace_arg = DeclareLaunchArgument( "namespace", - default_value="", + default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), description="Namespace for all topics and tfs", ) diff --git a/rosbot_gazebo/test/test_multirobot_diff_drive_simulation.py b/rosbot_gazebo/test/test_multirobot_diff_drive_simulation.py index 02607d8d..93188bfd 100644 --- a/rosbot_gazebo/test/test_multirobot_diff_drive_simulation.py +++ b/rosbot_gazebo/test/test_multirobot_diff_drive_simulation.py @@ -66,7 +66,7 @@ def generate_test_description(): @pytest.mark.launch(fixture=generate_test_description) def test_multirobot_simulation(): - robot_names = ["robot1", "robot2", "robot3", "robot4"] + robot_names = ["robot1", "robot2", "robot3"] rclpy.init() try: nodes = [] diff --git a/rosbot_gazebo/test/test_multirobot_mecanum_simulation.py b/rosbot_gazebo/test/test_multirobot_mecanum_simulation.py index c99bbc9b..f7467c7e 100644 --- a/rosbot_gazebo/test/test_multirobot_mecanum_simulation.py +++ b/rosbot_gazebo/test/test_multirobot_mecanum_simulation.py @@ -30,8 +30,6 @@ from test_utils import SimulationTestNode from test_ign_kill_utils import kill_ign_linux_processes -robot_names = ["robot1", "robot2", "robot3", "robot4"] - @launch_pytest.fixture def generate_test_description(): @@ -69,7 +67,7 @@ def generate_test_description(): @pytest.mark.launch(fixture=generate_test_description) def test_multirobot_mecanum_simulation(): - robot_names = ["robot1", "robot2", "robot3", "robot4"] + robot_names = ["robot1", "robot2", "robot3"] rclpy.init() try: nodes = []