From 1281fe6331bf47559c2c39221e494c2dcff693ec Mon Sep 17 00:00:00 2001 From: "Herman, Jessica (CIV)" Date: Fri, 26 May 2023 18:45:16 -0700 Subject: [PATCH 1/9] files for rviz tutorial --- vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz | 298 ++++++++++++++++++++++ vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 33 +++ 2 files changed, 331 insertions(+) create mode 100644 vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz create mode 100644 vrx_urdf/vrx_gazebo/launch/rviz.launch.py diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz new file mode 100644 index 000000000..81ac0bc72 --- /dev/null +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz @@ -0,0 +1,298 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + - /RobotModel1/Status1 + - /RobotModel1/Description Topic1 + Splitter Ratio: 0.5 + Tree Height: 549 + - 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 + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: /home/jessica/vrx_colcon_ws/install/share/vrx_gazebo/models/wamv/tmp/model.urdf + Description Source: File + 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 + wamv/ball_shooter_base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/ball_shooter_launcher_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/cpu_cases_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/front_left_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/front_right_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/gps_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/imu_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_battery_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_engine_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_propeller_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/middle_right_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/pinger: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/right_battery_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_engine_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_propeller_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: wamv + 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: 10 + 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.785398006439209 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.785398006439209 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 846 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000001d1000002b0fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002b0000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002b0fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002b0000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b0000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000001c4000002b000000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1200 + X: 60 + Y: 60 diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py new file mode 100644 index 000000000..2e2520a79 --- /dev/null +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -0,0 +1,33 @@ +from launch import LaunchDescription +from ament_index_python.packages import get_package_share_directory +from launch_ros.actions import Node +import os.path + + + +def generate_launch_description(): + + urdf_file = os.path.join(get_package_share_directory('vrx_gazebo'), 'models', 'wamv', 'tmp', 'model.urdf') + with open(urdf_file, 'r') as infp: + robot_desc = infp.read() + params = {'robot_description': robot_desc} + + rsp = Node(package='robot_state_publisher', + executable='robot_state_publisher', + output='both', + parameters=[params]) + jsp = Node(package='joint_state_publisher', + executable='joint_state_publisher', + output='both', + parameters=[]) + tfp = Node(package='tf2_ros', + executable='static_transform_publisher', + arguments=['0', '0', '0', '0', '0', '0', 'world', 'wamv/base_link']) + rvz = Node( + package='rviz2', + namespace='', + executable='rviz2', + name='rviz2', + arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx.rviz')] + ) + return LaunchDescription([rsp,jsp,tfp,rvz]) \ No newline at end of file From cea6baa16a23183c1025659dae55a41ae7fddc98 Mon Sep 17 00:00:00 2001 From: "Herman, Jessica (CIV)" Date: Fri, 2 Jun 2023 15:22:28 -0700 Subject: [PATCH 2/9] final rviz demo files --- .../{rviz_vrx.rviz => rviz_vrx_final.rviz} | 46 +- vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 23 +- .../urdf/components/wamv_p3d.xacro | 1 + .../wamv_gazebo/urdf/wamv_ground_truth.urdf | 1434 +++++++++++++++++ 4 files changed, 1480 insertions(+), 24 deletions(-) rename vrx_urdf/vrx_gazebo/config/{rviz_vrx.rviz => rviz_vrx_final.rviz} (88%) create mode 100644 vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz similarity index 88% rename from vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz rename to vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz index 81ac0bc72..c0cba01f5 100644 --- a/vrx_urdf/vrx_gazebo/config/rviz_vrx.rviz +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz @@ -7,10 +7,8 @@ Panels: - /Global Options1 - /Status1 - /RobotModel1 - - /RobotModel1/Status1 - - /RobotModel1/Description Topic1 Splitter Ratio: 0.5 - Tree Height: 549 + Tree Height: 355 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -53,14 +51,14 @@ Visualization Manager: - Alpha: 1 Class: rviz_default_plugins/RobotModel Collision Enabled: false - Description File: /home/jessica/vrx_colcon_ws/install/share/vrx_gazebo/models/wamv/tmp/model.urdf - Description Source: File + Description File: "" + Description Source: Topic Description Topic: Depth: 5 Durability Policy: Volatile History Policy: Keep Last Reliability Policy: Reliable - Value: robot_description + Value: /robot_description Enabled: true Links: All Links Enabled: true @@ -212,10 +210,24 @@ Visualization Manager: Update Interval: 0 Value: true Visual Enabled: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Image + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /wamv/sensors/cameras/front_left_camera_sensor/image_raw + Value: true Enabled: true Global Options: Background Color: 48; 48; 48 - Fixed Frame: wamv + Fixed Frame: map Frame Rate: 30 Name: root Tools: @@ -265,18 +277,18 @@ Visualization Manager: Swap Stereo Eyes: false Value: false Focal Point: - X: 0 - Y: 0 - Z: 0 - Focal Shape Fixed Size: true + X: -532.2940673828125 + Y: 162.00155639648438 + Z: -0.1315508484840393 + Focal Shape Fixed Size: false Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Pitch: 0.785398006439209 + Pitch: 0.7853981852531433 Target Frame: Value: Orbit (rviz) - Yaw: 0.785398006439209 + Yaw: 0.7853981852531433 Saved: ~ Window Geometry: Displays: @@ -284,7 +296,9 @@ Window Geometry: Height: 846 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd0000000400000000000001d1000002b0fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002b0000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002b0fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002b0000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b0000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000001c4000002b000000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Image: + collapsed: false + QMainWindow State: 000000ff00000000fd000000040000000000000156000002b0fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000001ee000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d0061006700650100000231000000bc0000002800ffffff000000010000010f000002b0fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002b0000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b0000002fb00fffffffb0000000800540069006d006501000000000000045000000000000000000000023f000002b000000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -294,5 +308,5 @@ Window Geometry: Views: collapsed: false Width: 1200 - X: 60 - Y: 60 + X: 393 + Y: 374 diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index 2e2520a79..c2653d098 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -1,4 +1,6 @@ from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration from ament_index_python.packages import get_package_share_directory from launch_ros.actions import Node import os.path @@ -7,10 +9,17 @@ def generate_launch_description(): - urdf_file = os.path.join(get_package_share_directory('vrx_gazebo'), 'models', 'wamv', 'tmp', 'model.urdf') + use_sim_time = LaunchConfiguration('use_sim_time', default='true') + #urdf_file = os.path.join(get_package_share_directory('vrx_gazebo'), 'models', 'wamv', 'tmp', 'model.urdf') + #urdf_file = '/home/jessica/vrx_colcon_ws/src/vrx/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf' + urdf_file = os.path.join(get_package_share_directory('wamv_gazebo'), 'urdf/wamv_ground_truth.urdf') with open(urdf_file, 'r') as infp: robot_desc = infp.read() - params = {'robot_description': robot_desc} + DeclareLaunchArgument( + 'use_sim_time', + default_value='true', + description='Use simulation (Gazebo) clock if true'), + params = {'use_sim_time': use_sim_time, 'robot_description': robot_desc} rsp = Node(package='robot_state_publisher', executable='robot_state_publisher', @@ -19,15 +28,13 @@ def generate_launch_description(): jsp = Node(package='joint_state_publisher', executable='joint_state_publisher', output='both', - parameters=[]) - tfp = Node(package='tf2_ros', - executable='static_transform_publisher', - arguments=['0', '0', '0', '0', '0', '0', 'world', 'wamv/base_link']) + parameters=[{'use_sim_time': use_sim_time}]) rvz = Node( package='rviz2', namespace='', executable='rviz2', name='rviz2', - arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx.rviz')] + #parameters={'use_sim_time': 'true'}, + arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_final.rviz')] ) - return LaunchDescription([rsp,jsp,tfp,rvz]) \ No newline at end of file + return LaunchDescription([rsp,jsp,rvz]) \ No newline at end of file diff --git a/vrx_urdf/wamv_gazebo/urdf/components/wamv_p3d.xacro b/vrx_urdf/wamv_gazebo/urdf/components/wamv_p3d.xacro index beac2fb34..b60718479 100644 --- a/vrx_urdf/wamv_gazebo/urdf/components/wamv_p3d.xacro +++ b/vrx_urdf/wamv_gazebo/urdf/components/wamv_p3d.xacro @@ -8,6 +8,7 @@ 3 10.0 map + wamv/base_link diff --git a/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf b/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf new file mode 100644 index 000000000..c60b46d69 --- /dev/null +++ b/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf @@ -0,0 +1,1434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/battery/mesh/battery_Albedo.png + model://vrx_gazebo/models/battery/mesh/battery_Normal.png + model://vrx_gazebo/models/battery/mesh/battery_Roughness.png + model://vrx_gazebo/models/battery/mesh/battery_Metalness.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/battery/mesh/battery_Albedo.png + model://vrx_gazebo/models/battery/mesh/battery_Normal.png + model://vrx_gazebo/models/battery/mesh/battery_Roughness.png + model://vrx_gazebo/models/battery/mesh/battery_Metalness.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Albedo.png + model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Normal.png + model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Roughness.png + model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Metalness.png + + + + + + + + wamv/base_link_fixed_joint_lump__top_base_collision_24 + wamv/base_link_fixed_joint_lump__left_float_collision + wamv/base_link_fixed_joint_lump__left_mid_float_collision_1 + wamv/base_link_fixed_joint_lump__left_front_float_collision_2 + wamv/base_link_fixed_joint_lump__right_float_collision_12 + wamv/base_link_fixed_joint_lump__right_mid_float_collision_13 + wamv/base_link_fixed_joint_lump__right_front_float_collision_14 + /vrx/contacts + + 1 + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wamv/left_engine_propeller_joint + 0.004422 + 1000 + 0.2 + true + + 2353.53383667818 + wamv + thrusters/left/thrust + + left + + + wamv/left_chassis_engine_joint + true + wamv/thrusters/left/pos + + left + + + + + wamv/right_engine_propeller_joint + 0.004422 + 1000 + 0.2 + true + + 2353.53383667818 + wamv + thrusters/right/thrust + + right + + + wamv/right_chassis_engine_joint + true + wamv/thrusters/right/pos + + right + + + + + + + wamv/base_link + 4.9 + 0.213 + 0 + + 0.6 1.03 0 + -1.4 1.03 0 + + + /vrx/wavefield/parameters + + + + + wamv/base_link + 4.9 + 0.213 + 0 + + 0.6 -1.03 0 + -1.4 -1.03 0 + + + /vrx/wavefield/parameters + + + + wamv/base_link + + 0.0 + 0.0 + 0.0 + + 51.3 + 72.4 + 40.0 + 0.0 + 500.0 + 100.0 + 100.0 + 400.0 + 0.0 + + + + + + 0.001 + + 0.00000004 + 0 + 0 + 0.00000004 + 0 + 0.00000004 + + + + + + 0.001 + + 0.00000004 + 0 + 0 + 0.00000004 + 0 + 0.00000004 + + + + + wamv_external_link + wamv/base_link + + 1 0 0 + + + 0 1 0 + + + + wamv_external_link_base + wamv_external_link + + + -3 + 3 + + 0 0 1 + + + + wamv_external_link_base + platform + dummy_base + /vrx/release + true + + + + + + + true + true + false + false + true + false + true + true + 1 + + + + + 3 + 10.0 + map + wamv/base_link + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Albedo.png + model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Normal.png + model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Roughness.png + model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Metalness.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png + + + + + + 30.0 + + 1.3962634 + + 1280 + 720 + R8G8B8 + + + 0.05 + 300 + + + gaussian + + 0.0 + 0.007 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png + + + + + + 30.0 + + 1.3962634 + + 1280 + 720 + R8G8B8 + + + 0.05 + 300 + + + gaussian + + 0.0 + 0.007 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png + model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png + + + + + + 30.0 + + 1.3962634 + + 1280 + 720 + R8G8B8 + + + 0.05 + 300 + + + gaussian + + 0.0 + 0.007 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 15 + + + + + + > + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + 15 + + + + + 0 + 0.009 + 0.00075 + 0.005 + 0.00002 + 400.0 + 0.00025 + + + + + 0 + 0.009 + 0.00075 + 0.005 + 0.00002 + 400.0 + 0.00025 + + + + + 0 + 0.009 + 0.00075 + 0.005 + 0.00002 + 400.0 + 0.00025 + + + + + + + 0 + 0.021 + 0.05 + 0.0075 + 0.000375 + 175.0 + 0.005 + + + + + 0 + 0.021 + 0.05 + 0.0075 + 0.000375 + 175.0 + 0.005 + + + + + 0 + 0.021 + 0.05 + 0.0075 + 0.000375 + 175.0 + 0.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Albedo.png + model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Normal.png + model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Roughness.png + model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Metalness.png + + + + + + 10 + + + + 1875.0 + 1 + -3.141592653589793 + 3.141592653589793 + + + 16 + 1 + -0.2617993877991494 + 0.2617993877991494 + + + + 0.1 + 130 + + + gaussian + 0.0 + 0.01 + + + + + + + + + + + + + + + + + + + + + -528 191 -2.0 + wamv/pingers/pinger/range_bearing + wamv/pingers/pinger/set_pinger_position + + wamv/pinger + + + gaussian + 0.0 + 3.0 + + + + + gaussian + 0.0 + 0.01 + + + + + gaussian + 0.0 + 0.01 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Albedo.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Normal.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Roughness.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Metalness.png + + + + + + + + + 1.0 1.0 1.0 + 1.0 1.0 1.0 + + + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Albedo.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Normal.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Roughness.png + model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Metalness.png + + + + + + + + + blue_projectile + link + wamv/ball_shooter_launcher_link + 0.14 0 0 0 0 0 + + 4 + 65 + wamv/shooters/ball_shooter/fire + + + From 496f920252c482c57aaf42090c6616e3ee7bb238 Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Tue, 6 Jun 2023 09:01:34 -0700 Subject: [PATCH 3/9] New frame for RVIZ visuals --- vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz | 12 ++++++------ vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz index c0cba01f5..8074fb9c9 100644 --- a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz @@ -277,16 +277,16 @@ Visualization Manager: Swap Stereo Eyes: false Value: false Focal Point: - X: -532.2940673828125 - Y: 162.00155639648438 - Z: -0.1315508484840393 + X: 0 + Y: 0 + Z: 0 Focal Shape Fixed Size: false Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 Pitch: 0.7853981852531433 - Target Frame: + Target Frame: wamv/base_link Value: Orbit (rviz) Yaw: 0.7853981852531433 Saved: ~ @@ -308,5 +308,5 @@ Window Geometry: Views: collapsed: false Width: 1200 - X: 393 - Y: 374 + X: 641 + Y: 119 diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index c2653d098..029deaa20 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -10,8 +10,6 @@ def generate_launch_description(): use_sim_time = LaunchConfiguration('use_sim_time', default='true') - #urdf_file = os.path.join(get_package_share_directory('vrx_gazebo'), 'models', 'wamv', 'tmp', 'model.urdf') - #urdf_file = '/home/jessica/vrx_colcon_ws/src/vrx/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf' urdf_file = os.path.join(get_package_share_directory('wamv_gazebo'), 'urdf/wamv_ground_truth.urdf') with open(urdf_file, 'r') as infp: robot_desc = infp.read() @@ -34,7 +32,6 @@ def generate_launch_description(): namespace='', executable='rviz2', name='rviz2', - #parameters={'use_sim_time': 'true'}, arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_final.rviz')] ) return LaunchDescription([rsp,jsp,rvz]) \ No newline at end of file From b103fdf9464b0cb8f659261ba14663139817786f Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Fri, 23 Jun 2023 13:19:34 -0700 Subject: [PATCH 4/9] remove pre-built urdf --- .../vrx_gazebo/config/rviz_vrx_final.rviz | 26 +- vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 5 +- .../wamv_gazebo/urdf/wamv_ground_truth.urdf | 1434 ----------------- 3 files changed, 17 insertions(+), 1448 deletions(-) delete mode 100644 vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz index 8074fb9c9..e433260ae 100644 --- a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz @@ -7,8 +7,9 @@ Panels: - /Global Options1 - /Status1 - /RobotModel1 - Splitter Ratio: 0.5 - Tree Height: 355 + - /RobotModel1/Status1 + Splitter Ratio: 0.550000011920929 + Tree Height: 478 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -187,6 +188,7 @@ Visualization Manager: Alpha: 1 Show Axes: false Show Trail: false + Value: true wamv/right_battery_link: Alpha: 1 Show Axes: false @@ -206,7 +208,7 @@ Visualization Manager: Inertia: false Mass: false Name: RobotModel - TF Prefix: "" + TF Prefix: wamv Update Interval: 0 Value: true Visual Enabled: true @@ -227,7 +229,7 @@ Visualization Manager: Enabled: true Global Options: Background Color: 48; 48; 48 - Fixed Frame: map + Fixed Frame: wamv/wamv/pinger Frame Rate: 30 Name: root Tools: @@ -285,20 +287,20 @@ Visualization Manager: Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Pitch: 0.7853981852531433 - Target Frame: wamv/base_link + Pitch: 0.4753985106945038 + Target Frame: wamv/wamv/base_link Value: Orbit (rviz) - Yaw: 0.7853981852531433 + Yaw: 3.0503997802734375 Saved: ~ Window Geometry: Displays: collapsed: false - Height: 846 + Height: 1016 Hide Left Dock: false Hide Right Dock: false Image: collapsed: false - QMainWindow State: 000000ff00000000fd000000040000000000000156000002b0fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000001ee000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d0061006700650100000231000000bc0000002800ffffff000000010000010f000002b0fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002b0000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b0000002fb00fffffffb0000000800540069006d006501000000000000045000000000000000000000023f000002b000000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd0000000400000000000001560000035afc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000269000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000002ac000000eb0000002800ffffff000000010000032a0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007360000003efc0100000002fb0000000800540069006d0065010000000000000736000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000002aa0000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -307,6 +309,6 @@ Window Geometry: collapsed: false Views: collapsed: false - Width: 1200 - X: 641 - Y: 119 + Width: 1846 + X: 74 + Y: 27 diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index 029deaa20..6846541bf 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -10,14 +10,15 @@ def generate_launch_description(): use_sim_time = LaunchConfiguration('use_sim_time', default='true') - urdf_file = os.path.join(get_package_share_directory('wamv_gazebo'), 'urdf/wamv_ground_truth.urdf') + model_dir = os.path.join(get_package_share_directory('vrx_gazebo'), 'models/wamv/tmp') + urdf_file = os.path.join(model_dir, 'model.urdf') with open(urdf_file, 'r') as infp: robot_desc = infp.read() DeclareLaunchArgument( 'use_sim_time', default_value='true', description='Use simulation (Gazebo) clock if true'), - params = {'use_sim_time': use_sim_time, 'robot_description': robot_desc} + params = {'use_sim_time': use_sim_time, 'ns': 'wamv', 'robot_description': robot_desc} rsp = Node(package='robot_state_publisher', executable='robot_state_publisher', diff --git a/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf b/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf deleted file mode 100644 index c60b46d69..000000000 --- a/vrx_urdf/wamv_gazebo/urdf/wamv_ground_truth.urdf +++ /dev/null @@ -1,1434 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/battery/mesh/battery_Albedo.png - model://vrx_gazebo/models/battery/mesh/battery_Normal.png - model://vrx_gazebo/models/battery/mesh/battery_Roughness.png - model://vrx_gazebo/models/battery/mesh/battery_Metalness.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/battery/mesh/battery_Albedo.png - model://vrx_gazebo/models/battery/mesh/battery_Normal.png - model://vrx_gazebo/models/battery/mesh/battery_Roughness.png - model://vrx_gazebo/models/battery/mesh/battery_Metalness.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Albedo.png - model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Normal.png - model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Roughness.png - model://wamv_description/models/WAM-V-Base/mesh/WAM-V_Metalness.png - - - - - - - - wamv/base_link_fixed_joint_lump__top_base_collision_24 - wamv/base_link_fixed_joint_lump__left_float_collision - wamv/base_link_fixed_joint_lump__left_mid_float_collision_1 - wamv/base_link_fixed_joint_lump__left_front_float_collision_2 - wamv/base_link_fixed_joint_lump__right_float_collision_12 - wamv/base_link_fixed_joint_lump__right_mid_float_collision_13 - wamv/base_link_fixed_joint_lump__right_front_float_collision_14 - /vrx/contacts - - 1 - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - wamv/left_engine_propeller_joint - 0.004422 - 1000 - 0.2 - true - - 2353.53383667818 - wamv - thrusters/left/thrust - - left - - - wamv/left_chassis_engine_joint - true - wamv/thrusters/left/pos - - left - - - - - wamv/right_engine_propeller_joint - 0.004422 - 1000 - 0.2 - true - - 2353.53383667818 - wamv - thrusters/right/thrust - - right - - - wamv/right_chassis_engine_joint - true - wamv/thrusters/right/pos - - right - - - - - - - wamv/base_link - 4.9 - 0.213 - 0 - - 0.6 1.03 0 - -1.4 1.03 0 - - - /vrx/wavefield/parameters - - - - - wamv/base_link - 4.9 - 0.213 - 0 - - 0.6 -1.03 0 - -1.4 -1.03 0 - - - /vrx/wavefield/parameters - - - - wamv/base_link - - 0.0 - 0.0 - 0.0 - - 51.3 - 72.4 - 40.0 - 0.0 - 500.0 - 100.0 - 100.0 - 400.0 - 0.0 - - - - - - 0.001 - - 0.00000004 - 0 - 0 - 0.00000004 - 0 - 0.00000004 - - - - - - 0.001 - - 0.00000004 - 0 - 0 - 0.00000004 - 0 - 0.00000004 - - - - - wamv_external_link - wamv/base_link - - 1 0 0 - - - 0 1 0 - - - - wamv_external_link_base - wamv_external_link - - - -3 - 3 - - 0 0 1 - - - - wamv_external_link_base - platform - dummy_base - /vrx/release - true - - - - - - - true - true - false - false - true - false - true - true - 1 - - - - - 3 - 10.0 - map - wamv/base_link - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Albedo.png - model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Normal.png - model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Roughness.png - model://vrx_gazebo/models/cpu_cases/mesh/cpu_cases_Metalness.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png - - - - - - 30.0 - - 1.3962634 - - 1280 - 720 - R8G8B8 - - - 0.05 - 300 - - - gaussian - - 0.0 - 0.007 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png - - - - - - 30.0 - - 1.3962634 - - 1280 - 720 - R8G8B8 - - - 0.05 - 300 - - - gaussian - - 0.0 - 0.007 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Albedo.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Normal.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Roughness.png - model://vrx_gazebo/models/mono_camera/mesh/mono_camera_Metalness.png - - - - - - 30.0 - - 1.3962634 - - 1280 - 720 - R8G8B8 - - - 0.05 - 300 - - - gaussian - - 0.0 - 0.007 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 15 - - - - - - > - - - - - - - - - - > - - - - - - - - - - - - - - - - - - - - 15 - - - - - 0 - 0.009 - 0.00075 - 0.005 - 0.00002 - 400.0 - 0.00025 - - - - - 0 - 0.009 - 0.00075 - 0.005 - 0.00002 - 400.0 - 0.00025 - - - - - 0 - 0.009 - 0.00075 - 0.005 - 0.00002 - 400.0 - 0.00025 - - - - - - - 0 - 0.021 - 0.05 - 0.0075 - 0.000375 - 175.0 - 0.005 - - - - - 0 - 0.021 - 0.05 - 0.0075 - 0.000375 - 175.0 - 0.005 - - - - - 0 - 0.021 - 0.05 - 0.0075 - 0.000375 - 175.0 - 0.005 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Albedo.png - model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Normal.png - model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Roughness.png - model://vrx_gazebo/models/3d_lidar/mesh/3d_Lidar_Metalness.png - - - - - - 10 - - - - 1875.0 - 1 - -3.141592653589793 - 3.141592653589793 - - - 16 - 1 - -0.2617993877991494 - 0.2617993877991494 - - - - 0.1 - 130 - - - gaussian - 0.0 - 0.01 - - - - - - - - - - - - - - - - - - - - - -528 191 -2.0 - wamv/pingers/pinger/range_bearing - wamv/pingers/pinger/set_pinger_position - - wamv/pinger - - - gaussian - 0.0 - 3.0 - - - - - gaussian - 0.0 - 0.01 - - - - - gaussian - 0.0 - 0.01 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Albedo.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Normal.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Roughness.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Metalness.png - - - - - - - - - 1.0 1.0 1.0 - 1.0 1.0 1.0 - - - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Albedo.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Normal.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Roughness.png - model://vrx_gazebo/models/ball_shooter/materials/Textures/Launcher_Metalness.png - - - - - - - - - blue_projectile - link - wamv/ball_shooter_launcher_link - 0.14 0 0 0 0 0 - - 4 - 65 - wamv/shooters/ball_shooter/fire - - - From bae4069f7716476db2620c5d2150afb03fdb2fa0 Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Mon, 26 Jun 2023 09:51:34 -0700 Subject: [PATCH 5/9] Revised RViz tutorial --- vrx_urdf/vrx_gazebo/CMakeLists.txt | 5 +- .../vrx_gazebo/config/rviz_vrx_final.rviz | 433 ++++++++++++------ vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 16 +- vrx_urdf/vrx_gazebo/package.xml | 3 +- vrx_urdf/vrx_gazebo/scripts/__init__.py | 0 .../scripts/robot_desc_publisher.py | 39 ++ 6 files changed, 336 insertions(+), 160 deletions(-) create mode 100644 vrx_urdf/vrx_gazebo/scripts/__init__.py create mode 100755 vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py diff --git a/vrx_urdf/vrx_gazebo/CMakeLists.txt b/vrx_urdf/vrx_gazebo/CMakeLists.txt index 3288b4f9d..6f9f92be1 100644 --- a/vrx_urdf/vrx_gazebo/CMakeLists.txt +++ b/vrx_urdf/vrx_gazebo/CMakeLists.txt @@ -20,9 +20,10 @@ install(DIRECTORY config/ # scripts -install(PROGRAMS scripts/generate_wamv.py +install(PROGRAMS scripts/generate_wamv.py + DESTINATION lib/${PROJECT_NAME}) +install(PROGRAMS scripts/robot_desc_publisher.py DESTINATION lib/${PROJECT_NAME}) - ament_python_install_package( vrx_gazebo diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz index e433260ae..fcc1ad78b 100644 --- a/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx_final.rviz @@ -7,9 +7,10 @@ Panels: - /Global Options1 - /Status1 - /RobotModel1 - - /RobotModel1/Status1 + - /RobotModel1/Link/Joint Tree1 + - /RobotModel1/Link/Joint Tree1/wamv/base_link1 Splitter Ratio: 0.550000011920929 - Tree Height: 478 + Tree Height: 459 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -61,149 +62,291 @@ Visualization Manager: Reliability Policy: Reliable Value: /robot_description Enabled: true - Links: - All Links Enabled: true + Link/Joint Tree: + All Links Enabled: false Expand Joint Details: false Expand Link Details: false Expand Tree: false - Link Tree Style: Links in Alphabetic Order - wamv/ball_shooter_base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/ball_shooter_launcher_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true + Link Tree Style: Tree of links and joints wamv/base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/cpu_cases_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_left_camera_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_left_camera_link_optical: - Alpha: 1 - Show Axes: false - Show Trail: false - wamv/front_left_camera_post_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_left_camera_post_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_right_camera_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_right_camera_link_optical: - Alpha: 1 - Show Axes: false - Show Trail: false - wamv/front_right_camera_post_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/front_right_camera_post_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/gps_wamv_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/imu_wamv_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/left_battery_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/left_engine_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/left_propeller_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/lidar_wamv_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/lidar_wamv_post_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/lidar_wamv_post_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/middle_right_camera_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/middle_right_camera_link_optical: - Alpha: 1 - Show Axes: false - Show Trail: false - wamv/middle_right_camera_post_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/middle_right_camera_post_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/pinger: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/right_battery_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/right_engine_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wamv/right_propeller_link: - Alpha: 1 - Show Axes: false - Show Trail: false + Details: + Alpha: 1 + Show Axes: false + Show Trail: false Value: true + wamv/ball_shooter_base_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/ball_shooter_base_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/ball_shooter_launcher_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/ball_shooter_launcher_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/base_to_front_left_camera_post_joint: + Details: + Show Axes: false + Value: false + wamv/front_left_camera_post_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_left_camera_post_to_front_left_camera_post_arm_joint: + Details: + Show Axes: false + Value: false + wamv/front_left_camera_post_arm_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_left_camera_post_arm_to_front_left_camera_joint: + Details: + Show Axes: false + Value: false + wamv/front_left_camera_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_left_camera_to_front_left_camera_link_optical_joint: + Details: + Show Axes: false + wamv/front_left_camera_link_optical: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/base_to_front_right_camera_post_joint: + Details: + Show Axes: false + Value: false + wamv/front_right_camera_post_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_right_camera_post_to_front_right_camera_post_arm_joint: + Details: + Show Axes: false + Value: false + wamv/front_right_camera_post_arm_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_right_camera_post_arm_to_front_right_camera_joint: + Details: + Show Axes: false + Value: false + wamv/front_right_camera_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/front_right_camera_to_front_right_camera_link_optical_joint: + Details: + Show Axes: false + wamv/front_right_camera_link_optical: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/base_to_lidar_wamv_post_joint: + Details: + Show Axes: false + Value: false + wamv/lidar_wamv_post_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/lidar_wamv_post_to_lidar_wamv_post_arm_joint: + Details: + Show Axes: false + Value: false + wamv/lidar_wamv_post_arm_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/lidar_wamv_post_arm_to_lidar_wamv_joint: + Details: + Show Axes: false + Value: false + wamv/lidar_wamv_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/base_to_middle_right_camera_post_joint: + Details: + Show Axes: false + Value: false + wamv/middle_right_camera_post_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/middle_right_camera_post_to_middle_right_camera_post_arm_joint: + Details: + Show Axes: false + Value: false + wamv/middle_right_camera_post_arm_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/middle_right_camera_post_arm_to_middle_right_camera_joint: + Details: + Show Axes: false + Value: false + wamv/middle_right_camera_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/middle_right_camera_to_middle_right_camera_link_optical_joint: + Details: + Show Axes: false + wamv/middle_right_camera_link_optical: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/chasis_cpu_cases_joint: + Details: + Show Axes: false + Value: false + wamv/cpu_cases_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/gps_wamv_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/gps_wamv_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/imu_wamv_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/imu_wamv_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_chasis_battery_joint: + Details: + Show Axes: false + Value: false + wamv/left_battery_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/left_chassis_engine_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/left_engine_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_engine_propeller_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/left_propeller_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/pinger_pinger_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: false + wamv/pinger: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/right_chasis_battery_joint: + Details: + Show Axes: false + Value: false + wamv/right_battery_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: false + wamv/right_chassis_engine_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/right_engine_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_engine_propeller_joint: + Details: + Show Axes: false + Show Joint Axis: false + Value: true + wamv/right_propeller_link: + Details: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true Mass Properties: Inertia: false Mass: false @@ -229,7 +372,7 @@ Visualization Manager: Enabled: true Global Options: Background Color: 48; 48; 48 - Fixed Frame: wamv/wamv/pinger + Fixed Frame: wamv Frame Rate: 30 Name: root Tools: @@ -287,10 +430,10 @@ Visualization Manager: Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Pitch: 0.4753985106945038 - Target Frame: wamv/wamv/base_link + Pitch: 0.635398805141449 + Target Frame: Value: Orbit (rviz) - Yaw: 3.0503997802734375 + Yaw: 1.4503977298736572 Saved: ~ Window Geometry: Displays: @@ -300,7 +443,7 @@ Window Geometry: Hide Right Dock: false Image: collapsed: false - QMainWindow State: 000000ff00000000fd0000000400000000000001560000035afc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000269000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000002ac000000eb0000002800ffffff000000010000032a0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007360000003efc0100000002fb0000000800540069006d0065010000000000000736000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000002aa0000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd0000000400000000000001de0000035afc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000256000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000001f0000000eb0000000000000000fb0000000a0049006d0061006700650100000299000000fe0000002800ffffff00000001000001ac0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007360000003efc0100000002fb0000000800540069006d0065010000000000000736000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000003a00000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index 6846541bf..2888724b6 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -14,20 +14,12 @@ def generate_launch_description(): urdf_file = os.path.join(model_dir, 'model.urdf') with open(urdf_file, 'r') as infp: robot_desc = infp.read() - DeclareLaunchArgument( - 'use_sim_time', - default_value='true', - description='Use simulation (Gazebo) clock if true'), - params = {'use_sim_time': use_sim_time, 'ns': 'wamv', 'robot_description': robot_desc} + params = {'robot_description': robot_desc} - rsp = Node(package='robot_state_publisher', - executable='robot_state_publisher', + rdp = Node(package='vrx_gazebo', + executable='robot_desc_publisher.py', output='both', parameters=[params]) - jsp = Node(package='joint_state_publisher', - executable='joint_state_publisher', - output='both', - parameters=[{'use_sim_time': use_sim_time}]) rvz = Node( package='rviz2', namespace='', @@ -35,4 +27,4 @@ def generate_launch_description(): name='rviz2', arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_final.rviz')] ) - return LaunchDescription([rsp,jsp,rvz]) \ No newline at end of file + return LaunchDescription([rdp,rvz]) \ No newline at end of file diff --git a/vrx_urdf/vrx_gazebo/package.xml b/vrx_urdf/vrx_gazebo/package.xml index a1afd1008..aa3b0dc24 100644 --- a/vrx_urdf/vrx_gazebo/package.xml +++ b/vrx_urdf/vrx_gazebo/package.xml @@ -14,7 +14,8 @@ Carlos Aguero vmrc_gazebo ament_cmake - + rclpy + std_msgs ament_cmake diff --git a/vrx_urdf/vrx_gazebo/scripts/__init__.py b/vrx_urdf/vrx_gazebo/scripts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py b/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py new file mode 100755 index 000000000..adf768644 --- /dev/null +++ b/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +import rclpy +from rclpy.node import Node +from rclpy.qos import QoSProfile, QoSDurabilityPolicy +from std_msgs.msg import String + + +class DescriptionPublisher(Node): + + def __init__(self): + super().__init__('description_publisher') + latching_qos = QoSProfile(depth=1, + durability=QoSDurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL) + self.publisher_ = self.create_publisher(String, '/robot_description', latching_qos) + self.declare_parameter('robot_description', '') + robot_desc = self.get_parameter('robot_description').get_parameter_value().string_value + msg = String() + msg.data = robot_desc + self.publisher_.publish(msg) + + + +def main(args=None): + rclpy.init(args=args) + + description_publisher = DescriptionPublisher() + + try: + rclpy.spin(description_publisher) + except KeyboardInterrupt: + description_publisher.get_logger().info("Ctrl-C detected, shutting down") + finally: + description_publisher.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() \ No newline at end of file From 340c96ddf6ed95e16f2e6db5b2f92b8a75f82d8d Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Tue, 27 Jun 2023 12:33:04 -0700 Subject: [PATCH 6/9] Adds robot_state_publisher to provide missing static transforms (temp fix) --- vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 12 ++++-- .../scripts/robot_desc_publisher.py | 39 ------------------- 2 files changed, 8 insertions(+), 43 deletions(-) delete mode 100755 vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index 2888724b6..b13b7798e 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -14,10 +14,14 @@ def generate_launch_description(): urdf_file = os.path.join(model_dir, 'model.urdf') with open(urdf_file, 'r') as infp: robot_desc = infp.read() - params = {'robot_description': robot_desc} + DeclareLaunchArgument( + 'use_sim_time', + default_value='true', + description='Use simulation (Gazebo) clock if true'), + params = {'use_sim_time': use_sim_time, 'frame_prefix': 'wamv/', 'robot_description': robot_desc, 'publish_frequency': 0.001} - rdp = Node(package='vrx_gazebo', - executable='robot_desc_publisher.py', + rsp = Node(package='robot_state_publisher', + executable='robot_state_publisher', output='both', parameters=[params]) rvz = Node( @@ -27,4 +31,4 @@ def generate_launch_description(): name='rviz2', arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_final.rviz')] ) - return LaunchDescription([rdp,rvz]) \ No newline at end of file + return LaunchDescription([rsp,rvz]) \ No newline at end of file diff --git a/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py b/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py deleted file mode 100755 index adf768644..000000000 --- a/vrx_urdf/vrx_gazebo/scripts/robot_desc_publisher.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 - -import rclpy -from rclpy.node import Node -from rclpy.qos import QoSProfile, QoSDurabilityPolicy -from std_msgs.msg import String - - -class DescriptionPublisher(Node): - - def __init__(self): - super().__init__('description_publisher') - latching_qos = QoSProfile(depth=1, - durability=QoSDurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL) - self.publisher_ = self.create_publisher(String, '/robot_description', latching_qos) - self.declare_parameter('robot_description', '') - robot_desc = self.get_parameter('robot_description').get_parameter_value().string_value - msg = String() - msg.data = robot_desc - self.publisher_.publish(msg) - - - -def main(args=None): - rclpy.init(args=args) - - description_publisher = DescriptionPublisher() - - try: - rclpy.spin(description_publisher) - except KeyboardInterrupt: - description_publisher.get_logger().info("Ctrl-C detected, shutting down") - finally: - description_publisher.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() \ No newline at end of file From d10727b8c5d60c177d94947e24100fb50f993324 Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Tue, 27 Jun 2023 13:14:32 -0700 Subject: [PATCH 7/9] remove unused node from CMakeLists --- vrx_urdf/vrx_gazebo/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/vrx_urdf/vrx_gazebo/CMakeLists.txt b/vrx_urdf/vrx_gazebo/CMakeLists.txt index 6f9f92be1..7df81e9e6 100644 --- a/vrx_urdf/vrx_gazebo/CMakeLists.txt +++ b/vrx_urdf/vrx_gazebo/CMakeLists.txt @@ -22,8 +22,6 @@ install(DIRECTORY config/ # scripts install(PROGRAMS scripts/generate_wamv.py DESTINATION lib/${PROJECT_NAME}) -install(PROGRAMS scripts/robot_desc_publisher.py - DESTINATION lib/${PROJECT_NAME}) ament_python_install_package( vrx_gazebo From 7b2a13fb1ef2a290b8e10b7e1ee27d86d8972168 Mon Sep 17 00:00:00 2001 From: Jessica Herman Date: Wed, 28 Jun 2023 13:59:50 -0700 Subject: [PATCH 8/9] publish wamv TF from urdf rather than sdf --- vrx_gz/src/vrx_gz/bridges.py | 8 + vrx_gz/src/vrx_gz/launch.py | 23 +- vrx_gz/src/vrx_gz/model.py | 6 +- vrx_urdf/vrx_gazebo/config/rviz_vrx_rsp.rviz | 313 ++++++++++++++++++ vrx_urdf/vrx_gazebo/launch/rviz.launch.py | 19 +- .../wamv_gazebo/urdf/wamv_gazebo.urdf.xacro | 12 +- 6 files changed, 357 insertions(+), 24 deletions(-) create mode 100644 vrx_urdf/vrx_gazebo/config/rviz_vrx_rsp.rviz diff --git a/vrx_gz/src/vrx_gz/bridges.py b/vrx_gz/src/vrx_gz/bridges.py index 28bbff234..16a273894 100644 --- a/vrx_gz/src/vrx_gz/bridges.py +++ b/vrx_gz/src/vrx_gz/bridges.py @@ -38,6 +38,14 @@ def pose_static(model_name): ros_type='tf2_msgs/msg/TFMessage', direction=BridgeDirection.GZ_TO_ROS) +def joint_states(world_name, model_name): + return Bridge( + gz_topic=f'/world/{world_name}/model/{model_name}/joint_state', + ros_topic='joint_states', + gz_type='ignition.msgs.Model', + ros_type='sensor_msgs/msg/JointState', + direction=BridgeDirection.GZ_TO_ROS) + def cmd_vel(model_name): return Bridge( gz_topic=f'/model/{model_name}/cmd_vel', diff --git a/vrx_gz/src/vrx_gz/launch.py b/vrx_gz/src/vrx_gz/launch.py index 26b428a37..601277026 100644 --- a/vrx_gz/src/vrx_gz/launch.py +++ b/vrx_gz/src/vrx_gz/launch.py @@ -19,7 +19,9 @@ from launch.actions import RegisterEventHandler from launch.event_handlers import OnProcessExit from launch.launch_description_sources import PythonLaunchDescriptionSource - +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration from launch.actions import ExecuteProcess, EmitEvent from launch.events import Shutdown @@ -196,6 +198,11 @@ def competition_bridges(world_name): def spawn(sim_mode, world_name, models, robot=None): if type(models) != list: models = [models] + use_sim_time = LaunchConfiguration('use_sim_time', default='true') + DeclareLaunchArgument( + 'use_sim_time', + default_value='true', + description='Use simulation (Gazebo) clock if true'), launch_processes = [] for model in models: @@ -231,13 +238,25 @@ def spawn(sim_mode, world_name, models, robot=None): remappings=[bridge.remapping() for bridge in bridges], )) - # tf broadcaster + # tf broadcaster (sensors) nodes.append(Node( package='vrx_ros', executable='pose_tf_broadcaster', output='screen', )) + # robot_state_publisher (tf for wamv) + model_dir = os.path.join(get_package_share_directory('vrx_gazebo'), 'models/wamv/tmp') + urdf_file = os.path.join(model_dir, 'model.urdf') + with open(urdf_file, 'r') as infp: + robot_desc = infp.read() + params = {'use_sim_time': use_sim_time, 'frame_prefix': 'wamv/', 'robot_description': robot_desc} + nodes.append(Node(package='robot_state_publisher', + executable='robot_state_publisher', + output='both', + parameters=[params], + remappings=[('/joint_states', '/wamv/joint_states')])) + group_action = GroupAction([ PushRosNamespace(model.model_name), *nodes diff --git a/vrx_gz/src/vrx_gz/model.py b/vrx_gz/src/vrx_gz/model.py index f89c72477..bed7047e4 100644 --- a/vrx_gz/src/vrx_gz/model.py +++ b/vrx_gz/src/vrx_gz/model.py @@ -67,9 +67,11 @@ def bridges(self, world_name): nodes = [] bridges = [ # pose - vrx_gz.bridges.pose(self.model_name), + vrx_gz.bridges.pose(self.model_name), # pose static - vrx_gz.bridges.pose_static(self.model_name), + vrx_gz.bridges.pose_static(self.model_name), + # joint states + vrx_gz.bridges.joint_states(world_name, self.model_name), # comms tx # vrx_gz.bridges.comms_tx(self.model_name), # comms rx diff --git a/vrx_urdf/vrx_gazebo/config/rviz_vrx_rsp.rviz b/vrx_urdf/vrx_gazebo/config/rviz_vrx_rsp.rviz new file mode 100644 index 000000000..2b0a964d1 --- /dev/null +++ b/vrx_urdf/vrx_gazebo/config/rviz_vrx_rsp.rviz @@ -0,0 +1,313 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + Splitter Ratio: 0.550000011920929 + Tree Height: 473 + - 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 + - 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: /wamv/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 + wamv/ball_shooter_base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/ball_shooter_launcher_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/cpu_cases_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/front_left_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_left_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/front_right_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/front_right_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/gps_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/imu_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_battery_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_engine_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/left_propeller_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/lidar_wamv_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + wamv/middle_right_camera_post_arm_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/middle_right_camera_post_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/pinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_battery_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_engine_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + wamv/right_propeller_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: wamv + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Image + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /wamv/sensors/cameras/front_left_camera_sensor/image_raw + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: wamv/wamv/base_link + 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: 10 + 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: false + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.5253987908363342 + Target Frame: + Value: Orbit (rviz) + Yaw: 2.6303977966308594 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1016 + Hide Left Dock: false + Hide Right Dock: false + Image: + collapsed: false + QMainWindow State: 000000ff00000000fd0000000400000000000001de0000035afc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000264000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000002a7000000f00000002800fffffffb0000000a0049006d0061006700650100000299000000fe000000000000000000000001000001ac0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007360000003efc0100000002fb0000000800540069006d0065010000000000000736000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000003a00000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1846 + X: 74 + Y: 27 diff --git a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py index b13b7798e..7e62ace33 100644 --- a/vrx_urdf/vrx_gazebo/launch/rviz.launch.py +++ b/vrx_urdf/vrx_gazebo/launch/rviz.launch.py @@ -9,26 +9,11 @@ def generate_launch_description(): - use_sim_time = LaunchConfiguration('use_sim_time', default='true') - model_dir = os.path.join(get_package_share_directory('vrx_gazebo'), 'models/wamv/tmp') - urdf_file = os.path.join(model_dir, 'model.urdf') - with open(urdf_file, 'r') as infp: - robot_desc = infp.read() - DeclareLaunchArgument( - 'use_sim_time', - default_value='true', - description='Use simulation (Gazebo) clock if true'), - params = {'use_sim_time': use_sim_time, 'frame_prefix': 'wamv/', 'robot_description': robot_desc, 'publish_frequency': 0.001} - - rsp = Node(package='robot_state_publisher', - executable='robot_state_publisher', - output='both', - parameters=[params]) rvz = Node( package='rviz2', namespace='', executable='rviz2', name='rviz2', - arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_final.rviz')] + arguments=['-d' + os.path.join(get_package_share_directory('vrx_gazebo'), 'config', 'rviz_vrx_rsp.rviz')] ) - return LaunchDescription([rsp,rvz]) \ No newline at end of file + return LaunchDescription([rvz]) \ No newline at end of file diff --git a/vrx_urdf/wamv_gazebo/urdf/wamv_gazebo.urdf.xacro b/vrx_urdf/wamv_gazebo/urdf/wamv_gazebo.urdf.xacro index fa9e0c0fc..477dc6f77 100644 --- a/vrx_urdf/wamv_gazebo/urdf/wamv_gazebo.urdf.xacro +++ b/vrx_urdf/wamv_gazebo/urdf/wamv_gazebo.urdf.xacro @@ -134,18 +134,24 @@ - true + false true false false - true + false false true - true + false 1 + + + + From 08ec0859938c8fe74aa6e94647e5e11a571b2bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ag=C3=BCero?= Date: Sat, 15 Jul 2023 16:22:22 +0200 Subject: [PATCH 9/9] Tweak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Agüero --- vrx_gz/src/vrx_gz/model.py | 4 ++-- vrx_urdf/vrx_gazebo/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vrx_gz/src/vrx_gz/model.py b/vrx_gz/src/vrx_gz/model.py index bed7047e4..0a8611140 100644 --- a/vrx_gz/src/vrx_gz/model.py +++ b/vrx_gz/src/vrx_gz/model.py @@ -67,9 +67,9 @@ def bridges(self, world_name): nodes = [] bridges = [ # pose - vrx_gz.bridges.pose(self.model_name), + vrx_gz.bridges.pose(self.model_name), # pose static - vrx_gz.bridges.pose_static(self.model_name), + vrx_gz.bridges.pose_static(self.model_name), # joint states vrx_gz.bridges.joint_states(world_name, self.model_name), # comms tx diff --git a/vrx_urdf/vrx_gazebo/CMakeLists.txt b/vrx_urdf/vrx_gazebo/CMakeLists.txt index 7df81e9e6..7c2e1f5dd 100644 --- a/vrx_urdf/vrx_gazebo/CMakeLists.txt +++ b/vrx_urdf/vrx_gazebo/CMakeLists.txt @@ -20,7 +20,7 @@ install(DIRECTORY config/ # scripts -install(PROGRAMS scripts/generate_wamv.py +install(PROGRAMS scripts/generate_wamv.py DESTINATION lib/${PROJECT_NAME}) ament_python_install_package(