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

husarion_gz_worlds pkg rename, FindPackageShare and isort #67

Merged
merged 9 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __pycache__/
rosbot_hardware_interfaces/
ros_components_description/
rosbot_controllers/
husarion/husarion_office_gz
husarion_gz_worlds
micro-ROS-Agent/
micro_ros_msgs/
industrial_ci/
Expand Down
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ repos:
files: ^(?!.*compose)(?!.*ekf\.yaml$).*$
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100']

# Please keep this version until --experimental-string-processing come back or will be available by default
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.4.0
hooks:
- id: black
args: [--line-length=99, --experimental-string-processing]
args: [--line-length=99]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
Expand All @@ -46,6 +45,12 @@ repos:
args: ['--ignore=E501,W503'] # ignore too long line and line break before binary operator,
# black checks it

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]

- repo: local
hooks:
- id: ament_lint_cmake
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ For further usage examples check out our other repositories:
* [`rosbot-xl-autonomy`](https://github.com/husarion/rosbot-xl-autonomy) - autonomous navigation & mapping based on Nav2
* [`rosbot-xl-telepresence`](https://github.com/husarion/rosbot-xl-telepresence) - control and receive signals in real time from any device across the Internet using Husarnet VPN
* [`rosbot-xl-manipulation`](https://github.com/husarion/rosbot-xl-manipulation) - integration of ROSbot XL with OpenManipulatorX

2 changes: 1 addition & 1 deletion ROS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Launch files for Ignition Gazebo working with ROS2 control.
| **include_camera_mount** | Whether to include camera mount to the robot URDF | **False** |
| **mecanum** | Whether to use mecanum drive controller, otherwise use diff drive | **False** |
| **namespace** | Namespace for all topics and tfs | **""** |
| **world** | Path to SDF world file | **`husarion_office_gz/`<br /> `worlds/husarion_world.sdf`** |
| **world** | Path to SDF world file | **`husarion_gz_worlds/`<br /> `worlds/husarion_world.sdf`** |
| **headless** | Run Gazebo Ignition in the headless mode | **False** |
| **robots** | List of robots that will be spawn in the simulation | **[]**\*\* |

Expand Down
4 changes: 2 additions & 2 deletions rosbot_xl/rosbot_xl_simulation.repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repositories:
husarion/husarion_office_gz:
husarion_gz_worlds:
type: git
url: https://github.com/husarion/husarion_office_gz
url: https://github.com/husarion/husarion_gz_worlds
version: main
12 changes: 5 additions & 7 deletions rosbot_xl_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
# limitations under the License.

from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.substitutions import PathJoinSubstitution, LaunchConfiguration
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource

from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node, SetParameter

from ament_index_python.packages import get_package_share_directory
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
Expand Down Expand Up @@ -92,8 +90,8 @@ def generate_launch_description():
description="Which simulation engine will be used",
)

rosbot_xl_controller = get_package_share_directory("rosbot_xl_controller")
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_controller = FindPackageShare("rosbot_xl_controller")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")

controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
19 changes: 13 additions & 6 deletions rosbot_xl_bringup/launch/combined.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from launch import LaunchDescription
from launch_ros.substitutions import FindPackageShare
from launch.actions import (
IncludeLaunchDescription,
DeclareLaunchArgument,
IncludeLaunchDescription,
LogInfo,
SetEnvironmentVariable,
OpaqueFunction,
SetEnvironmentVariable,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir, LaunchConfiguration
from launch.substitutions import (
LaunchConfiguration,
PathJoinSubstitution,
ThisLaunchFileDir,
)
from launch_ros.actions import Node
import os
from launch_ros.substitutions import FindPackageShare


def generate_microros_agent_node(context, *args, **kwargs):
Expand Down Expand Up @@ -129,7 +134,9 @@ def generate_launch_description():
package_dir = FindPackageShare("rosbot_xl_bringup").find("rosbot_xl_bringup")

# Construct the path to the XML file within the package
fastrtps_profiles_file = os.path.join(package_dir, "config", "microros_localhost_only.xml")
fastrtps_profiles_file = PathJoinSubstitution(
[package_dir, "config", "microros_localhost_only.xml"]
)

declare_localhost_only_fastrtps_profiles_file_arg = DeclareLaunchArgument(
"localhost_only_fastrtps_profiles_file",
Expand Down
1 change: 0 additions & 1 deletion rosbot_xl_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<exec_depend>ros2launch</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>ament_index_python</exec_depend>

<exec_depend>rosbot_xl_controller</exec_depend>

Expand Down
1 change: 1 addition & 0 deletions rosbot_xl_bringup/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
from glob import glob

from setuptools import find_packages, setup

package_name = "rosbot_xl_bringup"
Expand Down
2 changes: 1 addition & 1 deletion rosbot_xl_bringup/test/test_copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest
from ament_copyright.main import main


@pytest.mark.copyright
Expand Down
10 changes: 5 additions & 5 deletions rosbot_xl_bringup/test/test_diff_drive_ekf_and_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from threading import Thread

import launch_pytest
import pytest
import rclpy

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from test_utils import BringupTestNode, ekf_and_scan_test
from threading import Thread


@launch_pytest.fixture
def generate_test_description():
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
5 changes: 3 additions & 2 deletions rosbot_xl_bringup/test/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main_with_errors
from os.path import join, dirname
from os.path import dirname, join

import pytest
from ament_flake8.main import main_with_errors


@pytest.mark.flake8
Expand Down
10 changes: 5 additions & 5 deletions rosbot_xl_bringup/test/test_mecanum_ekf_and_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from threading import Thread

import launch_pytest
import pytest
import rclpy

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from test_utils import BringupTestNode, ekf_and_scan_test
from threading import Thread


@launch_pytest.fixture
def generate_test_description():
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
11 changes: 5 additions & 6 deletions rosbot_xl_bringup/test/test_multirobot_ekf_and_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from threading import Thread

import launch_pytest
import pytest
import rclpy

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from rclpy.executors import SingleThreadedExecutor
from test_utils import BringupTestNode, ekf_and_scan_test
from threading import Thread


robot_names = ["rosbot1", "rosbot2", "rosbot3"]


@launch_pytest.fixture
def generate_test_description():
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")
actions = []
for i in range(len(robot_names)):
bringup_launch = IncludeLaunchDescription(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from threading import Thread

import launch_pytest
import pytest
import rclpy

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from test_utils import BringupTestNode, ekf_and_scan_test
from threading import Thread


@launch_pytest.fixture
def generate_test_description():
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
10 changes: 5 additions & 5 deletions rosbot_xl_bringup/test/test_namespaced_mecanum_ekf_and_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from threading import Thread

import launch_pytest
import pytest
import rclpy

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from test_utils import BringupTestNode, ekf_and_scan_test
from threading import Thread


@launch_pytest.fixture
def generate_test_description():
rosbot_xl_bringup = get_package_share_directory("rosbot_xl_bringup")
rosbot_xl_bringup = FindPackageShare("rosbot_xl_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
2 changes: 1 addition & 1 deletion rosbot_xl_bringup/test/test_pep257.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest
from ament_pep257.main import main


@pytest.mark.linter
Expand Down
6 changes: 3 additions & 3 deletions rosbot_xl_bringup/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import rclpy
import math
import random

from threading import Event

import rclpy
from rclpy.node import Node
from sensor_msgs.msg import JointState, Imu, LaserScan
from sensor_msgs.msg import Imu, JointState, LaserScan
from tf2_ros import TransformException
from tf2_ros.buffer import Buffer
from tf2_ros.transform_listener import TransformListener
Expand Down
13 changes: 4 additions & 9 deletions rosbot_xl_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from launch.event_handlers import OnProcessExit
from launch import LaunchDescription
from launch.actions import (
DeclareLaunchArgument,
RegisterEventHandler,
OpaqueFunction,
)
from launch.actions import DeclareLaunchArgument, OpaqueFunction, RegisterEventHandler
from launch.conditions import UnlessCondition
from launch.event_handlers import OnProcessExit
from launch.substitutions import (
Command,
PythonExpression,
FindExecutable,
PathJoinSubstitution,
LaunchConfiguration,
PathJoinSubstitution,
PythonExpression,
)

from launch_ros.actions import Node, SetParameter
from launch_ros.substitutions import FindPackageShare

Expand Down
1 change: 0 additions & 1 deletion rosbot_xl_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<exec_depend>ros2launch</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>ament_index_python</exec_depend>

<exec_depend>rosbot_xl_description</exec_depend>
<exec_depend>ros_components_description</exec_depend>
Expand Down
1 change: 1 addition & 0 deletions rosbot_xl_controller/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
from glob import glob

from setuptools import find_packages, setup

package_name = "rosbot_xl_controller"
Expand Down
2 changes: 1 addition & 1 deletion rosbot_xl_controller/test/test_copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest
from ament_copyright.main import main


@pytest.mark.copyright
Expand Down
Loading
Loading