Skip to content

ROS2 Humble conversion #315

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

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from
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
10 changes: 8 additions & 2 deletions .ci.xacro_test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/sh
status=0
[ "$ROS_DISTRO" \< "melodic" ] && xacro_args='--inorder'
for x in $(find "$TARGET_REPO_PATH" -name '*.xacro'|sort); do
# Only set --inorder if running on older ROS 1 distros; for ROS 2 (Humble) we don't need it.
if [ -n "$ROS_DISTRO" ] && { [ "$ROS_DISTRO" = "indigo" ] || [ "$ROS_DISTRO" = "jade" ] || [ "$ROS_DISTRO" = "kinetic" ]; }; then
xacro_args='--inorder'
else
xacro_args=''
fi

for x in $(find "$TARGET_REPO_PATH" -name '*.xacro' | sort); do
echo "Testing $x"
xacro $xacro_args "$x" > /dev/null || status=1
done
Expand Down
122 changes: 122 additions & 0 deletions all_changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
diff --git a/.ci.xacro_test.sh b/.ci.xacro_test.sh
index d53f97b..a80e8a6 100644
--- a/.ci.xacro_test.sh
+++ b/.ci.xacro_test.sh
@@ -1,7 +1,13 @@
#!/bin/sh
status=0
-[ "$ROS_DISTRO" \< "melodic" ] && xacro_args='--inorder'
-for x in $(find "$TARGET_REPO_PATH" -name '*.xacro'|sort); do
+# Only set --inorder if running on older ROS 1 distros; for ROS 2 (Humble) we don't need it.
+if [ -n "$ROS_DISTRO" ] && { [ "$ROS_DISTRO" = "indigo" ] || [ "$ROS_DISTRO" = "jade" ] || [ "$ROS_DISTRO" = "kinetic" ]; }; then
+ xacro_args='--inorder'
+else
+ xacro_args=''
+fi
+
+for x in $(find "$TARGET_REPO_PATH" -name '*.xacro' | sort); do
echo "Testing $x"
xacro $xacro_args "$x" > /dev/null || status=1
done
diff --git a/cob_actions/package.xml b/cob_actions/package.xml
index 47261e4..be05704 100644
--- a/cob_actions/package.xml
+++ b/cob_actions/package.xml
@@ -16,4 +16,5 @@
<depend>action_msgs</depend>

<exec_depend>rosidl_default_runtime</exec_depend>
+ <member_of_group>rosidl_interface_packages</member_of_group>
</package>
diff --git a/cob_common/CMakeLists.txt b/cob_common/CMakeLists.txt
index edffff6..402eafb 100644
--- a/cob_common/CMakeLists.txt
+++ b/cob_common/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.8)
project(cob_common)

+# Make the ament_metapackage() command available.
find_package(ament_cmake REQUIRED)
-ament_metapackage()
+
+ament_package()
diff --git a/cob_common/package.xml b/cob_common/package.xml
index 9999397..63bbd3c 100644
--- a/cob_common/package.xml
+++ b/cob_common/package.xml
@@ -17,8 +17,6 @@
<exec_depend>cob_actions</exec_depend>
<exec_depend>cob_msgs</exec_depend>
<exec_depend>cob_srvs</exec_depend>
-
- <export>
- <metapackage/>
- </export>
+ <member_of_group>rosidl_interface_packages</member_of_group>
+
</package>
diff --git a/cob_msgs/msg/AccessPoint.msg b/cob_msgs/msg/AccessPoint.msg
index da7d9bd..84c5de9 100644
--- a/cob_msgs/msg/AccessPoint.msg
+++ b/cob_msgs/msg/AccessPoint.msg
@@ -1,5 +1,5 @@
# This message communicates the state of the PR2's wifi access point.
-Header header
+std_msgs/Header header
string essid
string macaddr
int32 signal
diff --git a/cob_msgs/msg/PowerState.msg b/cob_msgs/msg/PowerState.msg
index 47cf00d..d15d711 100644
--- a/cob_msgs/msg/PowerState.msg
+++ b/cob_msgs/msg/PowerState.msg
@@ -1,5 +1,5 @@
# This message communicates the state of the power system.
-Header header
+std_msgs/Header header
float64 voltage # [V]
float64 current # [A]
float64 power_consumption # [W] can only be calculated if not charging
diff --git a/cob_msgs/msg/SafetyControllerState.msg b/cob_msgs/msg/SafetyControllerState.msg
index 04a8e81..12b8d97 100644
--- a/cob_msgs/msg/SafetyControllerState.msg
+++ b/cob_msgs/msg/SafetyControllerState.msg
@@ -1,4 +1,4 @@
-Header header
+std_msgs/Header header
bool has_wireless_emstop
bool has_fall_sensors
bool has_magnetic_safety_switch
diff --git a/cob_msgs/msg/SiteSurvey.msg b/cob_msgs/msg/SiteSurvey.msg
index fadf87b..5d57c98 100644
--- a/cob_msgs/msg/SiteSurvey.msg
+++ b/cob_msgs/msg/SiteSurvey.msg
@@ -1,2 +1,2 @@
-Header header
+std_msgs/Header header
Network[] networks
diff --git a/cob_msgs/package.xml b/cob_msgs/package.xml
index 0575133..34a48cd 100644
--- a/cob_msgs/package.xml
+++ b/cob_msgs/package.xml
@@ -19,4 +19,5 @@
<depend>std_msgs</depend>

<exec_depend>rosidl_default_runtime</exec_depend>
+ <member_of_group>rosidl_interface_packages</member_of_group>
</package>
diff --git a/cob_srvs/package.xml b/cob_srvs/package.xml
index a51c8a3..24be9a6 100644
--- a/cob_srvs/package.xml
+++ b/cob_srvs/package.xml
@@ -13,8 +13,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
-
<depend>geometry_msgs</depend>
-
<exec_depend>rosidl_default_runtime</exec_depend>
+ <member_of_group>rosidl_interface_packages</member_of_group>
</package>
31 changes: 16 additions & 15 deletions cob_actions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(cob_actions)

find_package(catkin REQUIRED COMPONENTS actionlib_msgs geometry_msgs message_generation)
# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(action_msgs REQUIRED) # ROS 2 uses built-in action types

add_action_files(FILES
Dock.action
SetBool.action
SetFloat.action
SetInt.action
SetString.action
# Generate action interfaces.
# Make sure your action files are in the "action" directory.
rosidl_generate_interfaces(${PROJECT_NAME}
"action/Dock.action"
"action/SetBool.action"
"action/SetFloat.action"
"action/SetInt.action"
"action/SetString.action"
DEPENDENCIES geometry_msgs action_msgs
)

generate_messages(
DEPENDENCIES actionlib_msgs geometry_msgs
)

catkin_package(
CATKIN_DEPENDS actionlib_msgs geometry_msgs message_runtime
)
ament_package()
25 changes: 11 additions & 14 deletions cob_actions/package.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<package format="2">
<?xml version="1.0"?>
<package format="3">
<name>cob_actions</name>
<version>0.8.12</version>
<description>This Package contains Care-O-bot specific action definitions.</description>

<license>Apache 2.0</license>

<description>This package contains Care-O-bot specific action definitions.</description>
<license>Apache-2.0</license>
<url type="website">http://ros.org/wiki/cob_actions</url>
<!-- <url type="bugtracker"></url> -->

<maintainer email="[email protected]">Benjamin Maidel</maintainer>
<maintainer email="[email protected]">Denis Lehmann</maintainer>
<maintainer email="[email protected]">Felix Messmer</maintainer>
<author email="[email protected]">Felix Messmer</author>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<depend>actionlib_msgs</depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>geometry_msgs</depend>

<depend>action_msgs</depend>

<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
</package>
9 changes: 6 additions & 3 deletions cob_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(cob_common)
find_package(catkin REQUIRED)
catkin_metapackage()

# Make the ament_metapackage() command available.
find_package(ament_cmake REQUIRED)

ament_package()
23 changes: 11 additions & 12 deletions cob_common/package.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<package format="2">
<?xml version="1.0"?>
<package format="3">
<name>cob_common</name>
<version>0.8.12</version>
<description>The cob_common stack hosts common packages that are used within the Care-O-bot repository. E.g. utility packages or common message and service definitions etc. Also the urdf desciption of the robot is located in this stack.</description>
<license>Apache 2.0</license>

<description>
The cob_common stack hosts common packages used within the Care-O-bot repository, such as utility packages or common message and service definitions.
</description>
<license>Apache-2.0</license>
<url type="website">http://ros.org/wiki/cob_common</url>
<!-- <url type="bugtracker"></url> -->

<maintainer email="[email protected]">Benjamin Maidel</maintainer>
<maintainer email="[email protected]">Denis Lehmann</maintainer>
<maintainer email="[email protected]">Felix Messmer</maintainer>

<buildtool_depend>catkin</buildtool_depend>


<buildtool_depend>ament_cmake</buildtool_depend>

<!-- List dependencies on the subpackages -->
<exec_depend>cob_actions</exec_depend>
<exec_depend>cob_msgs</exec_depend>
<exec_depend>cob_srvs</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<metapackage/>
</export>
</package>
30 changes: 17 additions & 13 deletions cob_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(cob_msgs)
find_package(catkin REQUIRED COMPONENTS diagnostic_msgs message_generation std_msgs)

add_message_files(FILES
AccessPoint.msg
DashboardState.msg
EmergencyStopState.msg
Network.msg
PowerState.msg
SafetyControllerState.msg
SiteSurvey.msg
)
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(diagnostic_msgs REQUIRED)
find_package(std_msgs REQUIRED)

generate_messages(DEPENDENCIES diagnostic_msgs std_msgs)
# Assuming your message files are now located in the "msg" directory.
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/AccessPoint.msg"
"msg/DashboardState.msg"
"msg/EmergencyStopState.msg"
"msg/Network.msg"
"msg/PowerState.msg"
"msg/SafetyControllerState.msg"
"msg/SiteSurvey.msg"
DEPENDENCIES diagnostic_msgs std_msgs
)

catkin_package(CATKIN_DEPENDS diagnostic_msgs message_runtime std_msgs)
ament_package()
2 changes: 1 addition & 1 deletion cob_msgs/msg/AccessPoint.msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This message communicates the state of the PR2's wifi access point.
Header header
std_msgs/Header header
string essid
string macaddr
int32 signal
Expand Down
2 changes: 1 addition & 1 deletion cob_msgs/msg/PowerState.msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This message communicates the state of the power system.
Header header
std_msgs/Header header
float64 voltage # [V]
float64 current # [A]
float64 power_consumption # [W] can only be calculated if not charging
Expand Down
2 changes: 1 addition & 1 deletion cob_msgs/msg/SafetyControllerState.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Header header
std_msgs/Header header
bool has_wireless_emstop
bool has_fall_sensors
bool has_magnetic_safety_switch
Expand Down
2 changes: 1 addition & 1 deletion cob_msgs/msg/SiteSurvey.msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Header header
std_msgs/Header header
Network[] networks
17 changes: 8 additions & 9 deletions cob_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<package format="2">
<?xml version="1.0"?>
<package format="3">
<name>cob_msgs</name>
<version>0.8.12</version>
<description>
Messages for representing state information, such as battery information and emergency stop status.
Messages for representing state information, such as battery and emergency stop statuses.
</description>

<maintainer email="[email protected]">Benjamin Maidel</maintainer>
<maintainer email="[email protected]">Denis Lehmann</maintainer>
<maintainer email="[email protected]">Felix Messmer</maintainer>
<maintainer email="[email protected]">Florian Weisshardt</maintainer>
<author email="[email protected]">Florian Weisshardt</author>
<license>Apache-2.0</license>

<license>Apache 2.0</license>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>diagnostic_msgs</depend>
<depend>std_msgs</depend>

<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
</package>
24 changes: 11 additions & 13 deletions cob_srvs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(cob_srvs)

find_package(catkin REQUIRED COMPONENTS geometry_msgs message_generation)
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(geometry_msgs REQUIRED)

add_service_files(FILES
Dock.srv
SetFloat.srv
SetInt.srv
SetString.srv
)

generate_messages(
# Assuming your service files are now in the "srv" directory.
rosidl_generate_interfaces(${PROJECT_NAME}
"srv/Dock.srv"
"srv/SetFloat.srv"
"srv/SetInt.srv"
"srv/SetString.srv"
DEPENDENCIES geometry_msgs
)

catkin_package(
CATKIN_DEPENDS geometry_msgs message_runtime
)
ament_package()
Loading