diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..9f80f03 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,22 @@ +{ + "configurations": [ + { + "browse": { + "databaseFilename": "${default}", + "limitSymbolsToIncludedHeaders": false + }, + "includePath": [ + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/my_robot_interfaces/include/**", + "/opt/ros/humble/include/**", + "/home/ros-laptop1/Desktop/ros2_ws/src/my_robot1_description/include/**", + "/usr/include/**" + ], + "name": "ROS", + "intelliSenseMode": "gcc-x64", + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu11", + "cppStandard": "c++14" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..22ff4a0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "python.autoComplete.extraPaths": [ + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/turtlesim_catch_them_all/lib/python3.10/site-packages", + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/my_py_pkg/lib/python3.10/site-packages", + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/my_robot_interfaces/local/lib/python3.10/dist-packages", + "/opt/ros/humble/lib/python3.10/site-packages", + "/opt/ros/humble/local/lib/python3.10/dist-packages" + ], + "python.analysis.extraPaths": [ + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/turtlesim_catch_them_all/lib/python3.10/site-packages", + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/my_py_pkg/lib/python3.10/site-packages", + "/home/ros-laptop1/Desktop/turtlebotrhodes_ws/install/my_robot_interfaces/local/lib/python3.10/dist-packages", + "/opt/ros/humble/lib/python3.10/site-packages", + "/opt/ros/humble/local/lib/python3.10/dist-packages" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..94bd305 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Udemy Course 2 +This is my code and scripts from the udemy course I took [here](https://www.udemy.com/course/ros2-tf-urdf-rviz-gazebo). I was an amazing course and I would highly recommend it for getting an basic introduction to ROS 2. diff --git a/my_robot1_bringup/CMakeLists.txt b/my_robot1_bringup/CMakeLists.txt new file mode 100644 index 0000000..85912f1 --- /dev/null +++ b/my_robot1_bringup/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(my_robot1_bringup) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) + +install( + DIRECTORY launch rviz worlds + DESTINATION share/${PROJECT_NAME}/ +) + +ament_package() diff --git a/my_robot1_bringup/launch/my_robot1_gazebo.launch.xml b/my_robot1_bringup/launch/my_robot1_gazebo.launch.xml new file mode 100644 index 0000000..82a3a5e --- /dev/null +++ b/my_robot1_bringup/launch/my_robot1_gazebo.launch.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_bringup/package.xml b/my_robot1_bringup/package.xml new file mode 100644 index 0000000..547d343 --- /dev/null +++ b/my_robot1_bringup/package.xml @@ -0,0 +1,24 @@ + + + + my_robot1_bringup + 0.0.0 + TODO: Package description + ros-laptop1 + TODO: License declaration + + ament_cmake + + my_robot1_description + robot_state_publisher + gazebo_ros + + ament_lint_auto + ament_lint_common + + + + + ament_cmake + + diff --git a/my_robot1_bringup/rviz/urdf_config.rviz b/my_robot1_bringup/rviz/urdf_config.rviz new file mode 100644 index 0000000..7372d0f --- /dev/null +++ b/my_robot1_bringup/rviz/urdf_config.rviz @@ -0,0 +1,250 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 0 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + - /Camera1 + - /Camera1/Visibility1 + Splitter Ratio: 0.5 + Tree Height: 176 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_common/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: "" +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + base_footprint: + Value: true + base_link: + Value: true + camera_link: + Value: true + caster_wheel_link: + Value: true + left_wheel_link: + Value: true + odom: + Value: true + right_wheel_link: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + odom: + base_footprint: + base_link: + camera_link: + {} + caster_wheel_link: + {} + left_wheel_link: + {} + right_wheel_link: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + caster_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/Camera + Enabled: true + Far Plane Distance: 100 + Image Rendering: background and overlay + Name: Camera + Overlay Alpha: 0 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera_sensor/image_raw + Value: true + Visibility: + Grid: false + RobotModel: false + TF: false + Value: true + Zoom Factor: 1 + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: base_footprint + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 1.442779302597046 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.4553983211517334 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.16539859771728516 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1001 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000002cb00000323fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000007901000003fb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000004e000000ff000000ff01000003fb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d006500720061010000014e000002230000002e01000003000000010000011000000323fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000004e00000323000000d701000003fb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007800000004efc0100000002fb0000000800540069006d0065010000000000000780000002e701000003fb0000000800540069006d00650100000000000004500000000000000000000003a30000032300000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1920 + X: 0 + Y: 0 diff --git a/my_robot1_bringup/worlds/test_world.world.xml b/my_robot1_bringup/worlds/test_world.world.xml new file mode 100644 index 0000000..4698ae6 --- /dev/null +++ b/my_robot1_bringup/worlds/test_world.world.xml @@ -0,0 +1,2079 @@ + + + + 1 + 0 0 10 0 -0 0 + 0.8 0.8 0.8 1 + 0.2 0.2 0.2 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + 0 + 0 + 0 + + + + 1 + + + + + 0 0 1 + 100 100 + + + + + + 100 + 50 + + + + + + + + + + + 10 + + + 0 + + + 0 0 1 + 100 100 + + + + + + + 0 + 0 + 0 + + + 0 0 -9.8 + 6e-06 2.3e-05 -4.2e-05 + + + 0.001 + 1 + 1000 + + + 0.4 0.4 0.4 1 + 0.7 0.7 0.7 1 + 1 + + + + + EARTH_WGS84 + 0 + 0 + 0 + 0 + + + -2.08872 -0.736894 0 0 -0 0 + + 0 0 2.5 0 -0 0 + + -0.577138 0 0.05 0 -0 0 + + + 8.84572 5.5 0.1 + + + + + 1 1 1 1 + + + 1 + + + + + + 8.84572 5.5 0.1 + + + -0.577138 0 0.05 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.42286 -1.82502 0.05 0 -0 0 + + + 1.15427 1.84995 0.1 + + + + + 1 1 1 1 + + + 1 + + + + + + 1.15427 1.84995 0.1 + + + 4.42286 -1.82502 0.05 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.92286 0.924975 0.05 0 -0 0 + + + 0.154275 3.65005 0.1 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.154275 3.65005 0.1 + + + 4.92286 0.924975 0.05 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 2.67497 0.05 0 -0 0 + + + 1 0.15005 0.1 + + + + + 1 1 1 1 + + + 1 + + + + + + 1 0.15005 0.1 + + + 4.34572 2.67497 0.05 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + + 4.34572 2.48328 0.083333 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 2.48328 0.083333 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 2.24995 0.25 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 2.24995 0.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 2.01662 0.416667 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 2.01662 0.416667 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 1.78328 0.583333 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 1.78328 0.583333 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 1.54995 0.75 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 1.54995 0.75 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 1.31662 0.916667 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 1.31662 0.916667 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 1.08328 1.08333 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 1.08328 1.08333 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 0.84995 1.25 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 0.84995 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 0.616617 1.41667 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 0.616617 1.41667 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 0.383283 1.58333 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 0.383283 1.58333 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 0.14995 1.75 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 0.14995 1.75 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 -0.083383 1.91667 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 -0.083383 1.91667 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 -0.316717 2.08333 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 -0.316717 2.08333 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 -0.55005 2.25 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 -0.55005 2.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.34572 -0.783383 2.41667 0 -0 0 + + + 1 0.233333 0.166667 + + + + + 1 1 1 1 + + + 0 + + + + + + 1 0.233333 0.166667 + + + 4.34572 -0.783383 2.41667 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + 0 -2.675 2.5 0 -0 0 + + -2.76878 0 1.25 0 -0 0 + + + 4.46245 0.15 2.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 4.46245 0.15 2.5 + + + -2.76878 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 2.23122 0 0.25 0 -0 0 + + + 5.53755 0.15 0.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 5.53755 0.15 0.5 + + + 2.23122 0 0.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 2.63123 0 1.5 0 -0 0 + + + 4.73755 0.15 2 + + + + + 1 1 1 1 + + + 1 + + + + + + 4.73755 0.15 2 + + + 2.63123 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + -0.13755 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.8 0.15 1.2 + + + -0.13755 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + + + + 5.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0 0 1.25 0 -0 0 + + + 5.5 0.15 2.5 + + + + + 1 1 1 1 + + + 1 + + + 4.925 0 2.5 0 -0 1.5708 + 0 + 0 + 0 + + + 0 2.675 2.5 0 -0 3.14159 + + -4.8398 0 1.25 0 -0 0 + + + 0.3204 0.15 2.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.3204 0.15 2.5 + + + -4.8398 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0.1602 0 0.25 0 -0 0 + + + 9.6796 0.15 0.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 9.6796 0.15 0.5 + + + 0.1602 0 0.25 0 -0 0 + 10 + + + + + + + + + + + + + + + -1.02625 0 1.5 0 -0 0 + + + 5.7067 0.15 2 + + + + + 1 1 1 1 + + + 1 + + + + + + 5.7067 0.15 2 + + + -1.02625 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + 3.81355 0 1.5 0 -0 0 + + + 2.3729 0.15 2 + + + + + 1 1 1 1 + + + 1 + + + + + + 2.3729 0.15 2 + + + 3.81355 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + -4.2796 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.8 0.15 1.2 + + + -4.2796 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + + 2.2271 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.8 0.15 1.2 + + + 2.2271 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + -4.925 0 0 0 -0 -1.5708 + + -2.36366 0 1.25 0 -0 0 + + + 0.772675 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.772675 0.15 2.5 + + + -2.36366 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0.386338 0 0.25 0 -0 0 + + + 4.72733 0.15 0.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 4.72733 0.15 0.5 + + + 0.386338 0 0.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0.122087 0 1.5 0 -0 0 + + + 2.59883 0.15 2 + + + + + 1 1 1 1 + + + 0 + + + + + + 2.59883 0.15 2 + + + 0.122087 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + 2.48575 0 1.5 0 -0 0 + + + 0.5285 0.15 2 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.5285 0.15 2 + + + 2.48575 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + -1.57733 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.8 0.15 1.2 + + + -1.57733 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + + 1.8215 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.8 0.15 1.2 + + + 1.8215 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + + + + 10 0.15 2.5 + + + 0 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0 0 1.25 0 -0 0 + + + 10 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -0 -2.675 0 0 -0 0 + 0 + 0 + 0 + + + 4.925 0 0 0 -0 1.5708 + + -2.60994 0 1.25 0 -0 0 + + + 0.280125 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.280125 0.15 2.5 + + + -2.60994 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 0.590063 0 1.25 0 -0 0 + + + 4.31987 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 4.31987 0.15 2.5 + + + 0.590063 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + -2.01987 0 2.25 0 -0 0 + + + 0.9 0.15 0.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.9 0.15 0.5 + + + -2.01987 0 2.25 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + -0 2.675 0 0 -0 3.14159 + + -0.877463 0 1.25 0 -0 0 + + + 8.24507 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 8.24507 0.15 2.5 + + + -0.877463 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 4.57254 0 1.25 0 -0 0 + + + 0.854925 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.854925 0.15 2.5 + + + 4.57254 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 3.69508 0 2.25 0 -0 0 + + + 0.9 0.15 0.5 + + + + + 1 1 1 1 + + + 0 + + + + + + 0.9 0.15 0.5 + + + 3.69508 0 2.25 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + -4.925 0 2.5 0 -0 -1.5708 + + -1.49743 0 1.25 0 -0 0 + + + 2.50515 0.15 2.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 2.50515 0.15 2.5 + + + -1.49743 0 1.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 1.25257 0 0.25 0 -0 0 + + + 2.99485 0.15 0.5 + + + + + 1 1 1 1 + + + 1 + + + + + + 2.99485 0.15 0.5 + + + 1.25257 0 0.25 0 -0 0 + 10 + + + + + + + + + + + + + + + 1.65257 0 1.5 0 -0 0 + + + 2.19485 0.15 2 + + + + + 1 1 1 1 + + + 1 + + + + + + 2.19485 0.15 2 + + + 1.65257 0 1.5 0 -0 0 + 10 + + + + + + + + + + + + + + + 0.15515 0 1.9 0 -0 0 + + + 0.8 0.15 1.2 + + + + + 1 1 1 1 + + + 1 + + + + + + 0.8 0.15 1.2 + + + 0.15515 0 1.9 0 -0 0 + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + 1 + + + 1798 753000000 + 141 244573539 + 1734193840 926318799 + 140481 + + 0 0 0 0 -0 0 + 1 1 1 + + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -2.08872 -0.736894 0 0 -0 0 + 1 1 1 + + -2.08872 -0.736894 2.5 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -2.08872 -0.736894 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -2.08872 -3.41189 2.5 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + 2.83628 -0.736894 2.5 0 -0 1.5708 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -2.08872 1.93811 2.5 0 -0 3.14159 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -7.01372 -0.736894 0 0 0 -1.5708 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -2.08872 -3.41189 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + 2.83628 -0.736894 0 0 -0 1.5708 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -2.08872 1.93811 0 0 -0 3.14159 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -7.01372 -0.736894 2.5 0 0 -1.5708 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 0 0 10 0 -0 0 + + + + + -6.72419 0.432487 1.09435 0 0.009801 -0.103814 + orbit + perspective + + + + diff --git a/my_robot1_description/CMakeLists.txt b/my_robot1_description/CMakeLists.txt new file mode 100644 index 0000000..112a6bb --- /dev/null +++ b/my_robot1_description/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(my_robot1_description) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) + +install( + DIRECTORY urdf launch rviz + DESTINATION share/${PROJECT_NAME}/ +) + +ament_package() diff --git a/my_robot1_description/launch/display.launch.py b/my_robot1_description/launch/display.launch.py new file mode 100644 index 0000000..7fd5acc --- /dev/null +++ b/my_robot1_description/launch/display.launch.py @@ -0,0 +1,42 @@ +from launch import LaunchDescription +import os +from ament_index_python import get_package_share_directory +from launch_ros.parameter_descriptions import ParameterValue +from launch.substitutions import Command +from launch_ros.actions import Node + + +def generate_launch_description(): + + urdf_path = os.path.join(get_package_share_directory('my_robot1_description'), 'urdf', 'my_robot1.urdf.xacro') + robot_description = ParameterValue(Command(['xacro ', urdf_path]), value_type=str) + + rviz_config_path = os.path.join(get_package_share_directory('my_robot1_description'), 'rviz', 'urdf_config.rviz') + + robot_state_publisher_node = Node( + package="robot_state_publisher", + executable="robot_state_publisher", + parameters = [{"robot_description": robot_description}] + ) + + + joint_state_publisher_gui_node = Node( + package="joint_state_publisher_gui", + executable="joint_state_publisher_gui", + ) + + + rviz2_node = Node( + package="rviz2", + executable="rviz2", + arguments=['-d', rviz_config_path] + ) + + + + + return LaunchDescription([ + robot_state_publisher_node, + joint_state_publisher_gui_node, + rviz2_node + ]) \ No newline at end of file diff --git a/my_robot1_description/launch/display.launch.xml b/my_robot1_description/launch/display.launch.xml new file mode 100644 index 0000000..5b3f601 --- /dev/null +++ b/my_robot1_description/launch/display.launch.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/package.xml b/my_robot1_description/package.xml new file mode 100644 index 0000000..fe5f888 --- /dev/null +++ b/my_robot1_description/package.xml @@ -0,0 +1,18 @@ + + + + my_robot1_description + 0.0.0 + TODO: Package description + ros-laptop1 + TODO: License declaration + + ament_cmake + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/my_robot1_description/rviz/urdf_config.rviz b/my_robot1_description/rviz/urdf_config.rviz new file mode 100644 index 0000000..384d58e --- /dev/null +++ b/my_robot1_description/rviz/urdf_config.rviz @@ -0,0 +1,215 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 87 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + Splitter Ratio: 0.5 + Tree Height: 637 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_common/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: "" +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + base_footprint: + Value: true + base_link: + Value: true + caster_wheel_link: + Value: true + left_wheel_link: + Value: true + right_wheel_link: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + base_footprint: + base_link: + caster_wheel_link: + {} + left_wheel_link: + {} + right_wheel_link: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + caster_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: base_footprint + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 2.7850098609924316 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: -0.014601386152207851 + Target Frame: + Value: Orbit (rviz) + Yaw: 1.6503971815109253 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1001 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd00000004000000000000016a00000323fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000007901000003fb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000004e00000323000000ff01000003fb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000011000000323fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000004e00000323000000d701000003fb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007800000004efc0100000002fb0000000800540069006d0065010000000000000780000002e701000003fb0000000800540069006d00650100000000000004500000000000000000000005040000032300000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1920 + X: 0 + Y: 0 diff --git a/my_robot1_description/urdf/camera.xacro b/my_robot1_description/urdf/camera.xacro new file mode 100644 index 0000000..919eb46 --- /dev/null +++ b/my_robot1_description/urdf/camera.xacro @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gazebo/Red + + + 0 0 0 0 0 0 + + true + + 10.0 + + + camera_link + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf/common_properties.xacro b/my_robot1_description/urdf/common_properties.xacro new file mode 100644 index 0000000..e20d5d7 --- /dev/null +++ b/my_robot1_description/urdf/common_properties.xacro @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf/mobile_base.xacro b/my_robot1_description/urdf/mobile_base.xacro new file mode 100644 index 0000000..470851c --- /dev/null +++ b/my_robot1_description/urdf/mobile_base.xacro @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf/mobile_base_gazebo.xacro b/my_robot1_description/urdf/mobile_base_gazebo.xacro new file mode 100644 index 0000000..61c4f8e --- /dev/null +++ b/my_robot1_description/urdf/mobile_base_gazebo.xacro @@ -0,0 +1,73 @@ + + + + Gazebo/Blue + + + + Gazebo/Gray + + + + Gazebo/Gray + + + + Gazebo/Gray + + + + + + + + + 50 + + base_left_wheel_joint + base_right_wheel_joint + + ${wheel_length + base_width} + ${wheel_radius} + + + cmd_vel + + true + true + true + odom + odom + base_footprint + + + + + + + Gazebo/Orange + + + Gazebo/Yellow + + + Gazebo/Orange + + + + + + 10 + + + arm_base_forearm_joint + forearm_hand_joint + + + + + 2 + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf/my_robot1.urdf.xacro b/my_robot1_description/urdf/my_robot1.urdf.xacro new file mode 100644 index 0000000..8540957 --- /dev/null +++ b/my_robot1_description/urdf/my_robot1.urdf.xacro @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf/robot_arm.xacro b/my_robot1_description/urdf/robot_arm.xacro new file mode 100644 index 0000000..72482e2 --- /dev/null +++ b/my_robot1_description/urdf/robot_arm.xacro @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/arm.xacro b/my_robot1_description/urdf_his/arm.xacro new file mode 100644 index 0000000..42389a1 --- /dev/null +++ b/my_robot1_description/urdf_his/arm.xacro @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/arm_gazebo.xacro b/my_robot1_description/urdf_his/arm_gazebo.xacro new file mode 100644 index 0000000..2ce1256 --- /dev/null +++ b/my_robot1_description/urdf_his/arm_gazebo.xacro @@ -0,0 +1,35 @@ + + + + + Gazebo/Orange + + + + Gazebo/Yellow + + + + Gazebo/Orange + + + + + + 10 + + arm_base_forearm_joint + forearm_hand_joint + + + + + + + 2 + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/camera.xacro b/my_robot1_description/urdf_his/camera.xacro new file mode 100644 index 0000000..4b15a19 --- /dev/null +++ b/my_robot1_description/urdf_his/camera.xacro @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gazebo/Red + + 0 0 0 0 0 0 + true + 10.0 + + camera_link_optical + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/common_properties.xacro b/my_robot1_description/urdf_his/common_properties.xacro new file mode 100644 index 0000000..7b2760b --- /dev/null +++ b/my_robot1_description/urdf_his/common_properties.xacro @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/mobile_base.xacro b/my_robot1_description/urdf_his/mobile_base.xacro new file mode 100644 index 0000000..9b8b4aa --- /dev/null +++ b/my_robot1_description/urdf_his/mobile_base.xacro @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/mobile_base_gazebo.xacro b/my_robot1_description/urdf_his/mobile_base_gazebo.xacro new file mode 100644 index 0000000..16210ad --- /dev/null +++ b/my_robot1_description/urdf_his/mobile_base_gazebo.xacro @@ -0,0 +1,42 @@ + + + + + Gazebo/Blue + + + + Gazebo/Grey + + + + Gazebo/Grey + + + + Gazebo/Grey + + + + + + + + 50 + + base_left_wheel_joint + base_right_wheel_joint + + 0.45 + 0.2 + + true + true + true + odom + odom + base_footprint + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/my_robot.urdf.xacro b/my_robot1_description/urdf_his/my_robot.urdf.xacro new file mode 100644 index 0000000..c85f832 --- /dev/null +++ b/my_robot1_description/urdf_his/my_robot.urdf.xacro @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/my_robot1_description/urdf_his/standalone_arm.urdf.xacro b/my_robot1_description/urdf_his/standalone_arm.urdf.xacro new file mode 100644 index 0000000..76eec63 --- /dev/null +++ b/my_robot1_description/urdf_his/standalone_arm.urdf.xacro @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file