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

Rename-package #107

Merged
merged 6 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -10,7 +10,7 @@ log
rosbot_hardware_interfaces/
ros_components_description/
rosbot_controllers/
husarion/husarion_office_gz
husarion_gz_worlds
gazebosim/gz_ros2_control
diff_drive_controller
imu_sensor_broadcaster
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
4 changes: 2 additions & 2 deletions rosbot/rosbot_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
16 changes: 10 additions & 6 deletions rosbot_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
# limitations under the License.

from launch import LaunchDescription
from launch_ros.actions import Node, SetParameter
from ament_index_python.packages import get_package_share_directory
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution
from launch.substitutions import (
EnvironmentVariable,
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.actions import Node, SetParameter
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
Expand Down Expand Up @@ -50,8 +54,8 @@ def generate_launch_description():
choices=["ignition-gazebo", "gazebo-classic", "webots"],
)

rosbot_controller = get_package_share_directory("rosbot_controller")
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_controller = FindPackageShare("rosbot_controller")
rosbot_bringup = FindPackageShare("rosbot_bringup")

mecanum = LaunchConfiguration("mecanum")
declare_mecanum_arg = DeclareLaunchArgument(
Expand Down
11 changes: 6 additions & 5 deletions rosbot_bringup/launch/combined.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
# 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,
SetEnvironmentVariable,
IncludeLaunchDescription,
OpaqueFunction,
SetEnvironmentVariable,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir, LaunchConfiguration
from launch.substitutions import LaunchConfiguration, 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
1 change: 1 addition & 0 deletions rosbot_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_bringup"
Expand Down
2 changes: 1 addition & 1 deletion rosbot_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
7 changes: 3 additions & 4 deletions rosbot_bringup/test/test_diff_drive_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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


@launch_pytest.fixture
def generate_test_description():
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_bringup = FindPackageShare("rosbot_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
2 changes: 1 addition & 1 deletion rosbot_bringup/test/test_flake8.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_flake8.main import main_with_errors
import pytest
from ament_flake8.main import main_with_errors


@pytest.mark.flake8
Expand Down
7 changes: 3 additions & 4 deletions rosbot_bringup/test/test_mecanum_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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


@launch_pytest.fixture
def generate_test_description():
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_bringup = FindPackageShare("rosbot_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
7 changes: 3 additions & 4 deletions rosbot_bringup/test/test_multirobot_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
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

robot_names = ["robot1", "robot2", "robot3"]


@launch_pytest.fixture
def generate_test_description():
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_bringup = FindPackageShare("rosbot_bringup")
actions = []
for i in range(len(robot_names)):
bringup_launch = IncludeLaunchDescription(
Expand Down
7 changes: 3 additions & 4 deletions rosbot_bringup/test/test_namespaced_diff_drive_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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


@launch_pytest.fixture
def generate_test_description():
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_bringup = FindPackageShare("rosbot_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
7 changes: 3 additions & 4 deletions rosbot_bringup/test/test_namespaced_mecanum_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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


@launch_pytest.fixture
def generate_test_description():
rosbot_bringup = get_package_share_directory("rosbot_bringup")
rosbot_bringup = FindPackageShare("rosbot_bringup")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
2 changes: 1 addition & 1 deletion rosbot_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
11 changes: 4 additions & 7 deletions rosbot_bringup/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import rclpy

from threading import Event
from threading import Thread

from rclpy.node import Node
from threading import Event, Thread

from sensor_msgs.msg import JointState, Imu
import rclpy
from nav_msgs.msg import Odometry
from rclpy.node import Node
from sensor_msgs.msg import Imu, JointState


class BringupTestNode(Node):
Expand Down
5 changes: 2 additions & 3 deletions rosbot_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
from launch.conditions import UnlessCondition
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: 1 addition & 0 deletions rosbot_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_controller"
Expand Down
2 changes: 1 addition & 1 deletion rosbot_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
7 changes: 3 additions & 4 deletions rosbot_controller/test/test_diff_drive_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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 ControllersTestNode, controller_readings_test


@launch_pytest.fixture
def generate_test_description():
rosbot_controller = get_package_share_directory("rosbot_controller")
rosbot_controller = FindPackageShare("rosbot_controller")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
2 changes: 1 addition & 1 deletion rosbot_controller/test/test_flake8.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_flake8.main import main_with_errors
import pytest
from ament_flake8.main import main_with_errors


@pytest.mark.flake8
Expand Down
7 changes: 3 additions & 4 deletions rosbot_controller/test/test_mecanum_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
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 ControllersTestNode, controller_readings_test


@launch_pytest.fixture
def generate_test_description():
rosbot_controller = get_package_share_directory("rosbot_controller")
rosbot_controller = FindPackageShare("rosbot_controller")
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand Down
8 changes: 3 additions & 5 deletions rosbot_controller/test/test_multirobot_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@
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, TimerAction
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 ControllersTestNode, controller_readings_test

robot_names = ["robot1", "robot2", "robot3"]


@launch_pytest.fixture
def generate_test_description():
rosbot_controller = get_package_share_directory("rosbot_controller")
rosbot_controller = FindPackageShare("rosbot_controller")
actions = []
for i in range(len(robot_names)):
controller_launch = IncludeLaunchDescription(
Expand Down
Loading
Loading