Skip to content

Commit 5ccb3a9

Browse files
committed
Make a ros wrapper.
Signed-off-by: Jelmer de Wolde <[email protected]>
1 parent 104c3f3 commit 5ccb3a9

File tree

21 files changed

+883
-21
lines changed

21 files changed

+883
-21
lines changed

dockerfiles/install_scripts/dev_packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ source /home/$UNAME/.bashrc
99
apt update
1010

1111
apt install -y \
12-
ros-$ROS_DISTRO-nmea-navsat-driver
12+
ros-$ROS_DISTRO-nmea-navsat-driver

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dependencies = [
2222
"mashumaro>=3.16",
2323
"myst-parser>=4.0.1",
2424
"numpy<2.0",
25-
"opencv-python>=4.11.0.86",
2625
"pillow>=11.3.0",
2726
"pre-commit>=4.2.0",
2827
"psutil>=7.0.0",
@@ -44,9 +43,9 @@ dependencies = [
4443
"tornado>=6.5.1",
4544
"transforms3d>=0.4.2",
4645
"waitress>=3.0.2",
47-
"xmltodict>=1.0.2",
4846
"pandas>=2.2.0",
4947
"trimesh>=4.8.2",
48+
"xmltodict>=1.0.2",
5049
]
5150

5251
[dependency-groups]

ros2_ws/src/rcdt_gazebo/launch/gazebo_robot.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def generate_launch_description() -> LaunchDescription:
123123
world_arg.declaration,
124124
platforms_arg.declaration,
125125
positions_arg.declaration,
126+
orientations_arg.declaration,
126127
bridge_topics_arg.declaration,
127128
OpaqueFunction(function=launch_setup),
128129
]

ros2_ws/src/rcdt_gazebo/worlds/table_with_1_brick.sdf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ SPDX-License-Identifier: Apache-2.0
6969
</model>
7070

7171
<model name='brick0'>
72-
<pose>0.5 0 0 0 0 0</pose>
72+
<pose>0.5 0 0.03 0 0 0</pose>
7373
<include>
7474
<uri>model://rcdt_gazebo/models/brick</uri>
7575
</include>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-FileCopyrightText: Alliander N. V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
cmake_minimum_required(VERSION 3.5)
6+
project(rcdt_grasping)
7+
8+
# CMake dependencies:
9+
find_package(ament_cmake REQUIRED)
10+
find_package(ament_cmake_python REQUIRED)
11+
12+
# Other dependencies:
13+
find_package(rclpy REQUIRED)
14+
find_package(rcdt_utilities REQUIRED)
15+
16+
ament_python_install_package(${PROJECT_NAME})
17+
18+
# Python executables:
19+
install(
20+
DIRECTORY src_py/
21+
DESTINATION lib/${PROJECT_NAME}
22+
)
23+
24+
# Shared folders:
25+
install(
26+
DIRECTORY launch
27+
DESTINATION share/${PROJECT_NAME}
28+
)
29+
30+
# Default test:
31+
if(BUILD_TESTING)
32+
find_package(ament_lint_auto REQUIRED)
33+
ament_lint_auto_find_test_dependencies()
34+
endif()
35+
36+
ament_package()
11.9 MB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: Alliander N. V.
2+
3+
SPDX-License-Identifier: Apache-2.0
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-FileCopyrightText: Alliander N. V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
from launch import LaunchContext, LaunchDescription
6+
from launch.actions import OpaqueFunction
7+
from launch_ros.actions import Node
8+
from rcdt_utilities.launch_utils import LaunchArgument
9+
from rcdt_utilities.register import Register
10+
11+
namespace_arm_arg = LaunchArgument("namespace_arm", "")
12+
namespace_camera_arg = LaunchArgument("namespace_camera", "")
13+
14+
15+
def launch_setup(context: LaunchContext) -> list:
16+
"""Setup the launch description for the grasping node.
17+
18+
Args:
19+
context (LaunchContext): The launch context.
20+
21+
Returns:
22+
list: A list of actions to be executed in the launch description.
23+
"""
24+
namespace_arm = namespace_arm_arg.string_value(context)
25+
namespace_camera = namespace_camera_arg.string_value(context)
26+
27+
graspnet_node = Node(
28+
package="rcdt_grasping",
29+
executable="generate_grasp.py",
30+
)
31+
32+
grasping_logic = Node(
33+
package="rcdt_grasping",
34+
executable="grasp_logic.py",
35+
parameters=[
36+
{"namespace_arm": namespace_arm, "namespace_camera": namespace_camera}
37+
],
38+
)
39+
40+
return [
41+
Register.on_log(
42+
graspnet_node, "GraspNet model initialized and weights loaded", context
43+
),
44+
Register.on_log(grasping_logic, "GraspLogicNode initialized!", context),
45+
]
46+
47+
48+
def generate_launch_description() -> LaunchDescription:
49+
"""Generate the launch description for the grasping node.
50+
51+
Returns:
52+
LaunchDescription: The launch description containing the grasping node.
53+
"""
54+
return LaunchDescription(
55+
[
56+
namespace_arm_arg.declaration,
57+
namespace_camera_arg.declaration,
58+
OpaqueFunction(function=launch_setup),
59+
]
60+
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
4+
<!--
5+
SPDX-FileCopyrightText: Alliander N. V.
6+
7+
SPDX-License-Identifier: Apache-2.0
8+
-->
9+
10+
<package format="3">
11+
<name>rcdt_grasping</name>
12+
<version>0.1.0</version>
13+
<description>Package that contains functionality for grasping objects.</description>
14+
<maintainer email="[email protected]">RCDT</maintainer>
15+
<license>Apache 2.0</license>
16+
17+
<buildtool_depend>ament_cmake</buildtool_depend>
18+
<buildtool_depend>ament_cmake_python</buildtool_depend>
19+
20+
<depend>rcdt_utilities</depend>
21+
22+
<exec_depend>rclpy</exec_depend>
23+
24+
<export>
25+
<build_type>ament_cmake</build_type>
26+
</export>
27+
</package>

ros2_ws/src/rcdt_grasping/rcdt_grasping/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)