From 164cc3cc3fdb187832f1f8832f4ad5661a819b68 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 20 Jan 2022 20:16:02 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20add=20gazebo=5Fros=5Fstate=20plu?= =?UTF-8?q?gin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rasmt_support/CMakeLists.txt | 1 + rasmt_support/launch/rasmt_gazebo.launch.py | 32 +++-- rasmt_support/world/robossembler.world | 123 ++++++++++++++++++++ 3 files changed, 146 insertions(+), 10 deletions(-) create mode 100644 rasmt_support/world/robossembler.world diff --git a/rasmt_support/CMakeLists.txt b/rasmt_support/CMakeLists.txt index 5cf06a7..d0ec2ae 100644 --- a/rasmt_support/CMakeLists.txt +++ b/rasmt_support/CMakeLists.txt @@ -35,5 +35,6 @@ install(DIRECTORY urdf DESTINATION share/${PROJECT_NAME}) install(DIRECTORY meshes DESTINATION share/${PROJECT_NAME}) install(DIRECTORY config DESTINATION share/${PROJECT_NAME}) install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY world DESTINATION share/${PROJECT_NAME}) ament_package() diff --git a/rasmt_support/launch/rasmt_gazebo.launch.py b/rasmt_support/launch/rasmt_gazebo.launch.py index 13da416..086eb3d 100644 --- a/rasmt_support/launch/rasmt_gazebo.launch.py +++ b/rasmt_support/launch/rasmt_gazebo.launch.py @@ -18,15 +18,25 @@ def generate_launch_description(): description="Set robot name in gazebo env" )) - # Launch Gazebo - gazebo = IncludeLaunchDescription( - PythonLaunchDescriptionSource( - PathJoinSubstitution([ - FindPackageShare("gazebo_ros"), - "launch", - "gazebo.launch.py" - ]) - ) + world_file = os.path.join(get_package_share_directory("rasmt_support"), "world", "robossembler.world") + + gzserver = IncludeLaunchDescription( + PythonLaunchDescriptionSource( + PathJoinSubstitution([ + FindPackageShare("gazebo_ros"), + "launch", + "gzserver.launch.py" + ]) + ), launch_arguments={'world':world_file}.items() + ) + gzclient = IncludeLaunchDescription( + PythonLaunchDescriptionSource( + PathJoinSubstitution([ + FindPackageShare("gazebo_ros"), + "launch", + "gzclient.launch.py" + ]) + ) ) """xacro_file = os.path.join(get_package_share_directory("rasmt_support"),"urdf/","rasmt.xacro") @@ -55,7 +65,9 @@ def generate_launch_description(): )""" launch_nodes = [] - launch_nodes.append(gazebo) + #launch_nodes.append(gazebo) + launch_nodes.append(gzserver) + launch_nodes.append(gzclient) launch_nodes.append(spawn_entity) #launch_nodes.append(cube_spawn) diff --git a/rasmt_support/world/robossembler.world b/rasmt_support/world/robossembler.world new file mode 100644 index 0000000..bc8a33b --- /dev/null +++ b/rasmt_support/world/robossembler.world @@ -0,0 +1,123 @@ + + + + 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 + + + + + + model_states:=model_states_demo + + 1.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 + + + 46 800000000 + 46 908490360 + 1642692487 464939457 + 46800 + + 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 + + + + 0 0 10 0 -0 0 + + + + + 9.78871 -9.25042 4.66792 0 0.399643 2.3322 + orbit + perspective + + + +