From 59157bc2111b50b42308e7d158bacb8521402a81 Mon Sep 17 00:00:00 2001 From: kecks Date: Fri, 16 Aug 2024 16:23:41 +0200 Subject: [PATCH 1/3] [robots] added turtlebot3 (waffle_pi) --- launch/ik_and_description.launch | 6 + resources/robots/turtlebot3_waffle_pi.urdf | 371 ++++++++++++++++++ .../turtlebot3_waffle_pi_description.py | 13 + 3 files changed, 390 insertions(+) create mode 100644 resources/robots/turtlebot3_waffle_pi.urdf create mode 100644 src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py diff --git a/launch/ik_and_description.launch b/launch/ik_and_description.launch index 628fd7f82..41fe7035c 100644 --- a/launch/ik_and_description.launch +++ b/launch/ik_and_description.launch @@ -44,6 +44,12 @@ textfile="$(find pycram)/resources/robots/stretch_description.urdf"/> + + + + + diff --git a/resources/robots/turtlebot3_waffle_pi.urdf b/resources/robots/turtlebot3_waffle_pi.urdf new file mode 100644 index 000000000..b3a996afd --- /dev/null +++ b/resources/robots/turtlebot3_waffle_pi.urdf @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gazebo/DarkGrey + + + 0.1 + 0.1 + 500000.0 + 10.0 + 0.001 + 0.1 + 1 0 0 + Gazebo/FlatBlack + + + 0.1 + 0.1 + 500000.0 + 10.0 + 0.001 + 0.1 + 1 0 0 + Gazebo/FlatBlack + + + 0.1 + 0.1 + 1000000.0 + 100.0 + 0.001 + 1.0 + Gazebo/FlatBlack + + + 0.1 + 0.1 + 1000000.0 + 100.0 + 0.001 + 1.0 + Gazebo/FlatBlack + + + + true + false + + Gazebo/Grey + + + + cmd_vel + odom + odom + world + true + base_footprint + false + true + true + false + 30 + wheel_left_joint + wheel_right_joint + 0.287 + 0.066 + 1 + 10 + na + + + + + true + imu_link + imu_link + imu + imu_service + 0.0 + 0 + + + gaussian + + 0.0 + 2e-4 + 0.0000075 + 0.0000008 + + + 0.0 + 1.7e-2 + 0.1 + 0.001 + + + + + + + Gazebo/FlatBlack + + 0 0 0 0 0 0 + false + 5 + + + + 360 + 1 + 0.0 + 6.28319 + + + + 0.120 + 3.5 + 0.015 + + + gaussian + 0.0 + 0.01 + + + + scan + base_scan + + + + + + + true + false + + 1.085595 + + 640 + 480 + R8G8B8 + + + 0.03 + 100 + + + + true + 30.0 + camera + camera_rgb_optical_frame + rgb/image_raw + rgb/camera_info + 0.07 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py b/src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py new file mode 100644 index 000000000..b889117a8 --- /dev/null +++ b/src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py @@ -0,0 +1,13 @@ +import rospkg + +from pycram.robot_description import RobotDescriptionManager, RobotDescription + +rospack = rospkg.RosPack() +filename = rospack.get_path('pycram') + '/resources/robots/' + "turtlebot3_waffle_pi" + '.urdf' + +turtlebot3_waffle_pi = RobotDescription("turtlebot3_waffle_pi", "world", "base_link", "base_joint", + filename) + +# Add to RobotDescriptionManager +rdm = RobotDescriptionManager() +rdm.register_description(turtlebot3_waffle_pi) From c7ebb556eb905a717d5d11871779c432e9495e62 Mon Sep 17 00:00:00 2001 From: kecks Date: Wed, 21 Aug 2024 08:35:38 +0200 Subject: [PATCH 2/3] [robots] renamed turtlebot3_waffle_pi to turtlebot --- launch/ik_and_description.launch | 4 ++-- .../robots/{turtlebot3_waffle_pi.urdf => turtlebot.urdf} | 0 ...waffle_pi_description.py => turtlebot_description.py} | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) rename resources/robots/{turtlebot3_waffle_pi.urdf => turtlebot.urdf} (100%) rename src/pycram/robot_descriptions/{turtlebot3_waffle_pi_description.py => turtlebot_description.py} (52%) diff --git a/launch/ik_and_description.launch b/launch/ik_and_description.launch index 41fe7035c..4484eaf86 100644 --- a/launch/ik_and_description.launch +++ b/launch/ik_and_description.launch @@ -45,9 +45,9 @@ - + + textfile="$(find pycram)/resources/robots/turtlebot.urdf"/> diff --git a/resources/robots/turtlebot3_waffle_pi.urdf b/resources/robots/turtlebot.urdf similarity index 100% rename from resources/robots/turtlebot3_waffle_pi.urdf rename to resources/robots/turtlebot.urdf diff --git a/src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py b/src/pycram/robot_descriptions/turtlebot_description.py similarity index 52% rename from src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py rename to src/pycram/robot_descriptions/turtlebot_description.py index b889117a8..6e18cfd9b 100644 --- a/src/pycram/robot_descriptions/turtlebot3_waffle_pi_description.py +++ b/src/pycram/robot_descriptions/turtlebot_description.py @@ -2,12 +2,13 @@ from pycram.robot_description import RobotDescriptionManager, RobotDescription +# Description for turtlebot3_waffle_pi rospack = rospkg.RosPack() -filename = rospack.get_path('pycram') + '/resources/robots/' + "turtlebot3_waffle_pi" + '.urdf' +filename = rospack.get_path('pycram') + '/resources/robots/' + "turtlebot" + '.urdf' -turtlebot3_waffle_pi = RobotDescription("turtlebot3_waffle_pi", "world", "base_link", "base_joint", - filename) +turtlebot = RobotDescription("turtlebot", "world", "base_link", "base_joint", + filename) # Add to RobotDescriptionManager rdm = RobotDescriptionManager() -rdm.register_description(turtlebot3_waffle_pi) +rdm.register_description(turtlebot) From fecadc0ad194d53f08ef51dc7b81b477acba601d Mon Sep 17 00:00:00 2001 From: kecks Date: Wed, 21 Aug 2024 08:36:47 +0200 Subject: [PATCH 3/3] [tests] added test for loading turtlebot with RobotDescriptionManager --- test/test_robot_description.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_robot_description.py b/test/test_robot_description.py index 3e3985054..066babba6 100644 --- a/test/test_robot_description.py +++ b/test/test_robot_description.py @@ -12,6 +12,7 @@ class TestRobotDescription(unittest.TestCase): def setUpClass(cls): cls.path = str(pathlib.Path(__file__).parent.resolve()) + '/../resources/robots/' + "pr2" + '.urdf' cls.urdf_obj = URDF.from_xml_file(cls.path) + cls.path_turtlebot = str(pathlib.Path(__file__).parent.resolve()) + '/../resources/robots/' + "turtlebot" + '.urdf' def test_robot_description_construct(self): robot_description = RobotDescription("pr2", "base_link", "torso_lift_link", "torso_lift_joint", self.path) @@ -190,3 +191,13 @@ def test_load_robot_description(self): rdm.register_description(robot_description) rdm.load_description("pr2_test2") self.assertIs(RobotDescription.current_robot_description, robot_description) + + def test_robot_description_turtlebot(self): + robot_description = RobotDescription("turtlebot", "base_link", "base_link", "base_joint", self.path_turtlebot) + self.assertEqual(robot_description.name, "turtlebot") + self.assertEqual(robot_description.base_link, "base_link") + self.assertEqual(robot_description.torso_link, "base_link") + self.assertEqual(robot_description.torso_joint, "base_joint") + self.assertTrue(type(robot_description.urdf_object) is URDF) + self.assertEqual(len(robot_description.links), 11) + self.assertEqual(len(robot_description.joints), 10)