Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit ad8898a

Browse files
committed
Expose Gazebo topics
1 parent 419d16a commit ad8898a

File tree

9 files changed

+1217
-15
lines changed

9 files changed

+1217
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
rosdep update
2929
rosdep install --from-paths ./ -i -y --rosdistro rolling \
3030
--ignore-src
31+
apt-get upgrade -q -y --with-new-pkgs ros-rolling-rcl
3132
- name: Build project
3233
id: build
3334
run: |
@@ -46,7 +47,7 @@ jobs:
4647
container:
4748
image: osrf/ros:rolling-desktop
4849
steps:
49-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v2
5051
- name: Setup colcon workspace
5152
id: configure
5253
run: |
@@ -64,6 +65,7 @@ jobs:
6465
rosdep update
6566
rosdep install --from-paths ./ -i -y --rosdistro rolling \
6667
--ignore-src
68+
apt-get upgrade -q -y --with-new-pkgs ros-rolling-rcl
6769
- name: Build project
6870
id: build
6971
run: |

gazebo_ros2_control/CMakeLists.txt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5.0)
22
project(gazebo_ros2_control)
33

44
find_package(ament_cmake REQUIRED)
5+
find_package(service_msgs REQUIRED)
56
find_package(angles REQUIRED)
67
find_package(controller_manager REQUIRED)
78
find_package(gazebo_dev REQUIRED)
@@ -26,10 +27,11 @@ link_directories(
2627

2728
# Libraries
2829
add_library(${PROJECT_NAME} SHARED
29-
src/gazebo_ros2_control_plugin.cpp
30+
src/gazebo_ros2_control_plugin.cpp src/node.cc
3031
)
3132
ament_target_dependencies(${PROJECT_NAME}
3233
angles
34+
service_msgs
3335
controller_manager
3436
gazebo_dev
3537
gazebo_ros
@@ -62,18 +64,8 @@ ament_export_include_directories(
6264
include
6365
)
6466

65-
ament_export_dependencies(
66-
ament_cmake
67-
angles
68-
controller_manager
69-
gazebo_dev
70-
gazebo_ros
71-
hardware_interface
72-
pluginlib
73-
rclcpp
74-
yaml_cpp_vendor
75-
)
76-
67+
ament_export_dependencies(ament_cmake)
68+
ament_export_dependencies(rclcpp)
7769
ament_export_libraries(
7870
${PROJECT_NAME}
7971
gazebo_hardware_plugins

gazebo_ros2_control/include/gazebo_ros2_control/gazebo_system.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class GazeboSystem : public GazeboSystemInterface
7474
bool initSim(
7575
rclcpp::Node::SharedPtr & model_nh,
7676
gazebo::physics::ModelPtr parent_model,
77+
gazebo::transport::NodePtr & transport_nh,
7778
const hardware_interface::HardwareInfo & hardware_info,
7879
sdf::ElementPtr sdf) override;
7980

@@ -86,6 +87,10 @@ class GazeboSystem : public GazeboSystemInterface
8687
const hardware_interface::HardwareInfo & hardware_info,
8788
gazebo::physics::ModelPtr parent_model);
8889

90+
void registerGazeboTopics(
91+
const hardware_interface::HardwareInfo & hardware_info,
92+
gazebo::physics::ModelPtr parent_model);
93+
8994
/// \brief Private data class
9095
std::unique_ptr<GazeboSystemPrivate> dataPtr;
9196
};

gazebo_ros2_control/include/gazebo_ros2_control/gazebo_system_interface.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "hardware_interface/system_interface.hpp"
2828

29+
#include "gazebo_ros2_control/node.hh"
2930
#include "rclcpp/rclcpp.hpp"
3031

3132

@@ -69,6 +70,7 @@ class GazeboSystemInterface
6970
virtual bool initSim(
7071
rclcpp::Node::SharedPtr & model_nh,
7172
gazebo::physics::ModelPtr parent_model,
73+
gazebo::transport::NodePtr & transport_nh,
7274
const hardware_interface::HardwareInfo & hardware_info,
7375
sdf::ElementPtr sdf) = 0;
7476

0 commit comments

Comments
 (0)