Skip to content
Open
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
29 changes: 29 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Backport

on:
pull_request_target:
types: [closed]
workflow_dispatch:
inputs:
pr_number:
description: Pull request number to backport. Please add backport labels to the PR before running
this workflow.
required: true

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
if: >
(github.event_name == 'workflow_dispatch') ||
(
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
)
steps:
- uses: actions/checkout@v4
- uses: korthout/backport-action@v3
with:
github_token: ${{ secrets.GH_PAT }}
source_pr_number: ${{ inputs.pr_number || github.event.pull_request.number }}
3 changes: 2 additions & 1 deletion .github/workflows/release-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:

release_repository:
name: Release repository
needs: variables
uses: ./.github/workflows/release-repository.yaml
with:
release_candidate: ${{ needs.variables.outputs.RC_BRANCH_NAME }}
Expand Down Expand Up @@ -114,5 +115,5 @@ jobs:
owner: husarion
repo: docs_new
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build.yml
workflow_file_name: build.yaml
ref: master
1 change: 1 addition & 0 deletions .github/workflows/release-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ jobs:
- name: Update devel branch
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && inputs.automatic_mode }}
run: |
git config pull.rebase false
git pull origin ${{ env.MAIN_BRANCH }}
git push origin ${{ env.DEVEL_BRANCH }}
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ repos:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
entry: ament_copyright
language: system

Expand Down
2 changes: 1 addition & 1 deletion ROS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Below is information about the physical robot API. For the simulation, topics an
| ✅ | ✅ | `lights_controller` | This node is responsible for processing animations and publishing frames to `light_driver` node. <br/> [*husarion_ugv_lights/LightsControllerNode*](./husarion_ugv_lights/include/husarion_ugv_lights/lights_controller_node.hpp) |
| ✅ | ❌ | `lights_driver` | This node is responsible for displaying frames on the robot's lights. <br/> [*husarion_ugv_lights/LightsDriverNode*](./husarion_ugv_lights/include/husarion_ugv_lights/lights_driver_node.hpp) |
| ✅ | ✅ | `lights_manager` | Node responsible for managing lights animation scheduling. <br/> [husarion_ugv_manager/lights_manager](./husarion_ugv_manager/include/husarion_ugv_manager/lights_manager_node.hpp) |
| ✅ | ✅ | ⚙️ `navsat_transform` ⚙️ | It converts raw GPS data into odometry data and publishes corrected GPS positions based on sensor data at a higher frequency. <br/> *[robot_localization/navsat_transform](https://github.com/cra-ros-pkg/robot_localization)* |
| ✅ | ✅ | ⚙️ `navsat_transform` ⚙️ | It converts raw GPS data into odometry data and publishes corrected GPS positions based on sensor data at a higher frequency. <br/> *[robot_localization/navsat_transform](https://github.com/cra-ros-pkg/robot_localization)* |
| ✅ | ✅ | `robot_state_publisher` | Broadcasts a robot's state to tf2 using a provided URDF model and joint states. It updates the model and broadcasts poses for fixed and movable joints to tf2 topics. <br/> *[robot_state_publisher/robot_state_publisher](https://github.com/ros/robot_state_publisher)* |
| ✅ | ❌ | `safety_manager` | Node responsible for managing safety features, and software shutdown of components. <br/> *[husarion_ugv_manager/safety_manager_node](./husarion_ugv_manager/include/husarion_ugv_manager/safety_manager_node.hpp)* |
| ✅ | ❌ | `system_monitor` | Publishes system state of the Built-in Computer such as CPU usage, RAM memory usage, disk usage and CPU temperature. <br/> *[husarion_ugv_diagnostics/system_monitor_node](./husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/system_monitor_node.hpp)* |
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv)

find_package(ament_cmake REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_battery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv_battery)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv_bringup)

find_package(ament_cmake REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv_controller)

find_package(ament_cmake REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv_description)

find_package(ament_cmake REQUIRED)
Expand Down
26 changes: 23 additions & 3 deletions husarion_ugv_description/launch/load_urdf.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@


def generate_launch_description():
common_dir_path = LaunchConfiguration("common_dir_path")
declare_common_dir_path_arg = DeclareLaunchArgument(
"common_dir_path",
default_value="",
description="Path to the common configuration directory.",
)

description_pkg = FindPackageShare("husarion_ugv_description")
description_common_dir = PythonExpression(
[
"'",
common_dir_path,
"/husarion_ugv_description",
"' if '",
common_dir_path,
"' else '",
description_pkg,
"'",
]
)

battery_config_path = LaunchConfiguration("battery_config_path")
declare_battery_config_path_arg = DeclareLaunchArgument(
"battery_config_path",
Expand All @@ -46,9 +67,7 @@ def generate_launch_description():
components_config_path = LaunchConfiguration("components_config_path")
declare_components_config_path_arg = DeclareLaunchArgument(
"components_config_path",
default_value=PathJoinSubstitution(
[FindPackageShare("husarion_ugv_description"), "config", "components.yaml"]
),
default_value=PathJoinSubstitution([description_common_dir, "config", "components.yaml"]),
description=(
"Specify file which contains components. These components will be included in URDF."
"Available options can be found in manuals: https://husarion.com/manuals"
Expand Down Expand Up @@ -176,6 +195,7 @@ def generate_launch_description():
)

actions = [
declare_common_dir_path_arg,
declare_battery_config_path_arg,
declare_components_config_path_arg,
declare_robot_model_arg, # robot_model is used by wheel_type
Expand Down
3 changes: 0 additions & 3 deletions husarion_ugv_description/urdf/common/gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
<remapping>drive_controller/cmd_vel_unstamped:=cmd_vel</remapping>
<remapping>drive_controller/odom:=odometry/wheels</remapping>
<remapping>drive_controller/transition_event:=drive_controller/_transition_event</remapping>
<remapping>gz_ros2_control/e_stop:=hardware/e_stop</remapping>
<remapping>gz_ros2_control/e_stop_reset:=hardware/e_stop_reset</remapping>
<remapping>gz_ros2_control/e_stop_trigger:=hardware/e_stop_trigger</remapping>
<remapping>imu_broadcaster/imu:=imu/data</remapping>
<remapping>imu_broadcaster/transition_event:=imu_broadcaster/_transition_event</remapping>
<remapping>joint_state_broadcaster/transition_event:=joint_state_broadcaster/_transition_event</remapping>
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_diagnostics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.11)

# Handle superbuild first
option(USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON)
Expand Down
3 changes: 3 additions & 0 deletions husarion_ugv_diagnostics/cmake/SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ ExternalProject_Add(
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ep_cppuprofile
BUILD_COMMAND $(MAKE) -C <BINARY_DIR>
INSTALL_COMMAND make install INSTALL_PREFIX=<INSTALL_DIR>
# DCMAKE_POLICY_VERSION_MINIMUM is required because of using external
# `cppuprofile` repo in the diagnostics pkg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
BUILD_IN_SOURCE 1)

ExternalProject_Add(
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.11)
project(husarion_ugv_gazebo)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
23 changes: 0 additions & 23 deletions husarion_ugv_gazebo/config/gz_bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,3 @@
ros_type_name: rosgraph_msgs/msg/Clock
gz_type_name: gz.msgs.Clock
direction: GZ_TO_ROS

- ros_topic_name: battery/battery_status
gz_topic_name: /model/<model_name>/battery/<namespace>/battery/state
ros_type_name: sensor_msgs/msg/BatteryState
gz_type_name: gz.msgs.BatteryState
direction: GZ_TO_ROS

- topic_name: cmd_vel
ros_type_name: geometry_msgs/msg/Twist
gz_type_name: gz.msgs.Twist
direction: GZ_TO_ROS

- ros_topic_name: lights/channel_1_frame
gz_topic_name: <namespace>/lights/channel_1_frame
ros_type_name: sensor_msgs/msg/Image
gz_type_name: gz.msgs.Image
direction: ROS_TO_GZ

- ros_topic_name: lights/channel_2_frame
gz_topic_name: <namespace>/lights/channel_2_frame
ros_type_name: sensor_msgs/msg/Image
gz_type_name: gz.msgs.Image
direction: ROS_TO_GZ
23 changes: 23 additions & 0 deletions husarion_ugv_gazebo/config/robot_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# For detailed information on configuring the parameter_bridge, please refer to:
# https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_bridge#example-5-configuring-the-bridge-via-yaml

- ros_topic_name: /<namespace>/battery/battery_status
gz_topic_name: /model/<model_name>/battery/<namespace>/battery/state
ros_type_name: sensor_msgs/msg/BatteryState
gz_type_name: gz.msgs.BatteryState
direction: GZ_TO_ROS

- topic_name: /<namespace>/cmd_vel
ros_type_name: geometry_msgs/msg/TwistStamped
gz_type_name: gz.msgs.Twist
direction: GZ_TO_ROS

- topic_name: /<namespace>/lights/channel_1_frame
ros_type_name: sensor_msgs/msg/Image
gz_type_name: gz.msgs.Image
direction: ROS_TO_GZ

- topic_name: /<namespace>/lights/channel_2_frame
ros_type_name: sensor_msgs/msg/Image
gz_type_name: gz.msgs.Image
direction: ROS_TO_GZ
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using TriggerSrv = std_srvs::srv::Trigger;

/**
* @brief Main class for the Husarion UGV which implements a simulated `ros2_control`
* `hardware_interface::SystemInterface`. This class inherits `gz_ros2_control::GazeboSystem`
* `hardware_interface::SystemInterface`. This class inherits `gz_ros2_control::GazeboSimSystem`
* and implements additional functionalities like E-stop handling.
*/
class EStopSystem : public gz_ros2_control::GazeboSimSystem
Expand Down
6 changes: 3 additions & 3 deletions husarion_ugv_gazebo/launch/simulate_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def generate_launch_description():
declare_gz_bridge_config_path_arg = DeclareLaunchArgument(
"gz_bridge_config_path",
default_value=PathJoinSubstitution(
[FindPackageShare("husarion_ugv_gazebo"), "config", "gz_bridge.yaml"]
[FindPackageShare("husarion_ugv_gazebo"), "config", "robot_bridge.yaml"]
),
description="Path to the parameter_bridge configuration file.",
)
Expand Down Expand Up @@ -204,10 +204,10 @@ def generate_launch_description():
)

model_name = PythonExpression(["'", namespace, "' if '", namespace, "' else 'panther'"])

ns = PythonExpression(["'", namespace, "' + '/' if '", namespace, "' else ''"])
namespaced_gz_bridge_config_path = ReplaceString(
source_file=gz_bridge_config_path,
replacements={"<model_name>": model_name, "<namespace>": namespace, "//": "/"},
replacements={"<model_name>": model_name, "<namespace>/": ns},
)

gz_bridge = Node(
Expand Down
32 changes: 21 additions & 11 deletions husarion_ugv_gazebo/launch/simulation.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.actions import SetUseSimTime
from launch_ros.actions import Node, SetUseSimTime
from launch_ros.substitutions import FindPackageShare
from nav2_common.launch import ReplaceString

Expand Down Expand Up @@ -76,42 +76,52 @@ def generate_launch_description():
launch_arguments={"gz_gui": namespaced_gz_gui, "gz_log_level": "1"}.items(),
)

rviz_launch = IncludeLaunchDescription(
gz_bridge_config = PathJoinSubstitution(
[FindPackageShare("husarion_ugv_gazebo"), "config", "gz_bridge.yaml"]
)
gz_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
name="gz_bridge",
parameters=[{"config_file": gz_bridge_config}],
)

simulate_robots = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare("husarion_ugv_description"),
FindPackageShare("husarion_ugv_gazebo"),
"launch",
"rviz.launch.py",
"simulate_robot.launch.py",
]
)
),
condition=IfCondition(use_rviz),
launch_arguments={"log_level": log_level}.items(),
)

simulate_robots = IncludeLaunchDescription(
rviz_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare("husarion_ugv_gazebo"),
FindPackageShare("husarion_ugv_description"),
"launch",
"simulate_robot.launch.py",
"rviz.launch.py",
]
)
),
launch_arguments={"log_level": log_level}.items(),
condition=IfCondition(use_rviz),
)

actions = [
declare_gz_gui,
declare_log_level_arg,
declare_namespace_arg,
declare_use_rviz_arg,
# Sets use_sim_time for all nodes started below (doesn't work for nodes started from ignition gazebo)
SetUseSimTime(True),
gz_sim,
rviz_launch,
gz_bridge,
simulate_robots,
rviz_launch,
]

return LaunchDescription(actions)
Loading