-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/ros2-docking' into ros2-joy-plugin
- Loading branch information
Showing
30 changed files
with
2,469 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: Pre-Commit | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
pre-commit: | ||
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master | ||
with: | ||
ros_distro: humble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# ROS API | ||
|
||
> [!IMPORTANT] | ||
> **Beta Release** | ||
> | ||
> Please be advised that the software you are about to use is a Beta version of the ROS 2 Driver for Panther. It is functional, and the architecture will not change significantly. Although it has been tested by the Husarion team, some stability issues and bugs may still occur. | ||
> | ||
> [!IMPORTANT] | ||
> **Beta Release** | ||
> | ||
> Please be advised that the software you are about to use is a Beta version of the ROS 2 Driver for Panther. It is functional, and the architecture will not change significantly. Although it has been tested by the Husarion team, some stability issues and bugs may still occur. | ||
> | ||
> We would greatly appreciate your feedback regarding the Panther ROS 2 driver. You can reach us in the following ways: | ||
> | ||
> | ||
> - By email at: [[email protected]](mailto:[email protected]) | ||
> - Via our community forum: [Husarion Community](https://community.husarion.com) | ||
> - By submitting an issue request on: [GitHub](https://github.com/husarion/panther_ros/issues) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(panther_docking) | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
set(PACKAGE_DEPENDENCIES | ||
ament_cmake | ||
geometry_msgs | ||
opennav_docking_core | ||
opennav_docking | ||
panther_utils | ||
pluginlib | ||
rclcpp | ||
sensor_msgs | ||
std_srvs | ||
tf2_geometry_msgs | ||
tf2_ros) | ||
|
||
foreach(PACKAGE IN ITEMS ${PACKAGE_DEPENDENCIES}) | ||
find_package(${PACKAGE} REQUIRED) | ||
endforeach() | ||
|
||
include_directories(include) | ||
|
||
pluginlib_export_plugin_description_file(opennav_docking_core plugin.xml) | ||
|
||
add_library(panther_charging_dock SHARED src/panther_charging_dock.cpp) | ||
ament_target_dependencies(panther_charging_dock ${PACKAGE_DEPENDENCIES}) | ||
# TODO @delihus how to link the library what is not a name of a package | ||
target_link_libraries(panther_charging_dock | ||
/opt/ros/humble/lib/libpose_filter.so) | ||
|
||
install(TARGETS panther_charging_dock LIBRARY DESTINATION lib) | ||
|
||
install(DIRECTORY config launch DESTINATION share/${PROJECT_NAME}) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
|
||
ament_add_gtest(${PROJECT_NAME}_test_panther_charging_dock | ||
test/test_panther_charging_dock.cpp) | ||
target_link_libraries(${PROJECT_NAME}_test_panther_charging_dock | ||
panther_charging_dock) | ||
ament_target_dependencies(${PROJECT_NAME}_test_panther_charging_dock | ||
${PACKAGE_DEPENDENCIES}) | ||
endif() | ||
|
||
ament_export_include_directories(include) | ||
ament_export_libraries(panther_charging_dock) | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# panther_docking | ||
|
||
The package contains a `PantherChargingDock` plugin for the [opennav_docking](https://github.com/open-navigation/opennav_docking) project. Thanks to this package, Panther can dock to a charging station. | ||
|
||
## Launch Files | ||
|
||
- `docking.launch.py`: Launch a node that creates `docking_server` and run a `PantherChargingDock` plugin. | ||
|
||
## Configuration Files | ||
|
||
- [`panther_docking_server.yaml`](./config/panther_docking_server.yaml): Defines parameters for a `docking_server` and a `PantherChargingDock` plugin. | ||
|
||
## ROS Nodes | ||
|
||
- `PantherChargingDock`: A plugin for a Panther robot what is responsible for a charger service. | ||
|
||
### PantherChargingDock | ||
|
||
#### Publishes | ||
|
||
- `docking/dock_pose` [*geometry_msgs/PoseStamped*]: An offset dock pose. | ||
- `docking/staging_pose` [*geometry_msgs/PoseStamped*]: An offset staging pose next to a charging station. | ||
|
||
#### Subscribers | ||
|
||
- `battery/charging_status` [*panther_msgs/ChargingStatus*]: A charging status of Panther robot. | ||
- `hardware/io_state` [*panther_msgs/IOState*]: States of GPIOs of Panther robot. The `PantherChargingDock` subscribes this topic to check if a robot charges. | ||
|
||
#### Service Clients | ||
|
||
- `hardware/charger_enable` [*std_srvs/SetBoot*]: This service client enables charging in a robot. | ||
|
||
#### Parameters | ||
|
||
- `~panther_version` [*double*, default: **1.21**]: A version of Panther robot. | ||
- `~<dock_name>.base_frame` [*string*, default: **base_link**]: A base frame id of a robot. | ||
- `~<dock_name>.external_detection_timeout` [*double*, default: **0.2**]: A timeout in seconds for looking up a transformation from an april tag of a dock to a base frame id. | ||
- `~<dock_name>.external_detection_translation_x` [*double*, default: **0.0**]: A translation over an X axis between a detected frame and a dock pose. | ||
- `~<dock_name>.external_detection_translation_y` [*double*, default: **0.0**]: A translation over an Y axis between a detected frame and a dock pose. | ||
- `~<dock_name>.external_detection_translation_x` [*double*, default: **0.0**]: A translation over a Z axis between a detected frame and a dock pose. | ||
- `~<dock_name>.external_detection_rotation_roll` [*double*, default: **0.0**]: A rotation over an X axis between a detected frame and a dock pose. | ||
- `~<dock_name>.external_detection_rotation_pitch` [*double*, default: **0.0**]: A rotation over an Y axis between a detected frame and a dock pose. | ||
- `~<dock_name>.external_detection_rotation_yaw` [*double*, default: **0.0**]: A rotation over a Z axis between a detected frame and a dock pose. | ||
- `~<dock_name>.filter_coef` [*double*, default: **0.1**]: A key parameter that influences the trade-off between the filter's responsiveness and its smoothness, balancing how quickly it reacts to new pose data pose how much it smooths out fluctuations. | ||
- `~<dock_name>.docking_distance_threshold` [*double*, default: **0.05**]: A threshold of a distance between a robot pose and a dock pose to declare if docking succeed. | ||
- `~<dock_name>.docking_yaw_threshold` [*double*, default: **0.3**]: A threshold of a difference of yaw angles between a robot pose and a dock pose to declare if docking succeed. | ||
- `~<dock_name>.staging_x_offset` [*double*, default: **-0.7**]: A staging pose is defined by offsetting a dock pose in axis X. | ||
- `~<dock_name>.staging_yaw_offset` [*double*, default: **0.0**]: A staging pose is defined by offsetting a yaw angle. | ||
- `~<dock_name>.enable_charger_service_call_timeout` [*double*, default: **0.2**]: A timeout for calling enable charging service. A robot is unable to dock if excised. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/**: | ||
ros__parameters: | ||
controller_frequency: 50.0 | ||
initial_perception_timeout: 5.0 | ||
wait_charge_timeout: 5.0 | ||
dock_approach_timeout: 20.0 | ||
undock_linear_tolerance: 0.08 | ||
undock_angular_tolerance: 0.08 | ||
max_retries: 3 | ||
base_frame: "<robot_namespace>/base_link" | ||
fixed_frame: "<robot_namespace>/odom" | ||
dock_backwards: false | ||
dock_prestaging_tolerance: 0.5 | ||
|
||
|
||
dock_plugins: ["panther_charging_dock"] | ||
panther_charging_dock: | ||
plugin: panther_docking::PantherChargingDock | ||
base_frame: "<robot_namespace>/base_link" | ||
docking_distance_threshold: 0.15 | ||
docking_yaw_threshold: 0.15 | ||
staging_x_offset: -0.5 | ||
staging_yaw_offset: 0.0 | ||
|
||
# TODO: @delihus Try to remove this parameters by using docking station description in the ros_components_description | ||
# Transform between april tag frame and dock pose. An april tag Z+ faces always a camera | ||
external_detection_timeout: 0.3 | ||
external_detection_translation_x: 0.0 | ||
external_detection_translation_y: -0.175 # Distance between the detection and ground | ||
external_detection_translation_z: 0.8 # Distance between the detection and the front of the robot | ||
external_detection_rotation_roll: 0.0 | ||
external_detection_rotation_pitch: 1.57 | ||
external_detection_rotation_yaw: 0.0 | ||
filter_coef: 0.1 | ||
|
||
enable_charger_service_call_timeout: 1.0 | ||
|
||
docks: ["main_dock"] | ||
main_dock: | ||
type: panther_charging_dock | ||
frame: <robot_namespace>/main_dock | ||
pose: [0.0, 0.0, 0.0] # position of the dock device (not the staging position), the front (X+) of the dock should point away from the robot | ||
|
||
controller: | ||
k_phi: 1.0 | ||
k_delta: 2.0 | ||
v_linear_min: 0.05 | ||
v_linear_max: 0.2 | ||
v_angular_max: 0.3 |
Oops, something went wrong.