diff --git a/launch/ik_and_description.launch b/launch/ik_and_description.launch index 628fd7f82..4484eaf86 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/turtlebot.urdf b/resources/robots/turtlebot.urdf new file mode 100644 index 000000000..b3a996afd --- /dev/null +++ b/resources/robots/turtlebot.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/turtlebot_description.py b/src/pycram/robot_descriptions/turtlebot_description.py new file mode 100644 index 000000000..6e18cfd9b --- /dev/null +++ b/src/pycram/robot_descriptions/turtlebot_description.py @@ -0,0 +1,14 @@ +import rospkg + +from pycram.robot_description import RobotDescriptionManager, RobotDescription + +# Description for turtlebot3_waffle_pi +rospack = rospkg.RosPack() +filename = rospack.get_path('pycram') + '/resources/robots/' + "turtlebot" + '.urdf' + +turtlebot = RobotDescription("turtlebot", "world", "base_link", "base_joint", + filename) + +# Add to RobotDescriptionManager +rdm = RobotDescriptionManager() +rdm.register_description(turtlebot) 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)