mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
fixed MapCloud rviz plugin with rtabmap namespace property. rtabmap.launch.py: added "rviz" argument to start RVIZ with preconfigured displays. point_cloud_xyzrgb: added RGBA encoding support for stereo.
This commit is contained in:
@@ -0,0 +1,339 @@
|
||||
Panels:
|
||||
- Class: rviz_common/Displays
|
||||
Help Height: 78
|
||||
Name: Displays
|
||||
Property Tree Widget:
|
||||
Expanded:
|
||||
- /Global Options1
|
||||
- /Status1
|
||||
Splitter Ratio: 0.5147058963775635
|
||||
Tree Height: 505
|
||||
- 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
|
||||
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: <Fixed Frame>
|
||||
Value: true
|
||||
- Class: rtabmap_ros/Info
|
||||
Enabled: true
|
||||
Name: Info
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/info
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rtabmap_ros/MapCloud
|
||||
Cloud decimation: 4
|
||||
Cloud from scan: false
|
||||
Cloud max depth (m): 4
|
||||
Cloud min depth (m): 0
|
||||
Cloud voxel size (m): 0.009999999776482582
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: RGB8
|
||||
Download graph: false
|
||||
Download map: false
|
||||
Download namespace: rtabmap
|
||||
Enabled: true
|
||||
Filter ceiling (m): 0
|
||||
Filter floor (m): 0
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: MapCloud
|
||||
Node filtering angle (degrees): 30
|
||||
Node filtering radius (m): 0
|
||||
Position Transformer: XYZ
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Points
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/mapData
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Class: rtabmap_ros/MapGraph
|
||||
Enabled: true
|
||||
Global loop closure: 255; 0; 0
|
||||
Landmark: 0; 128; 0
|
||||
Local loop closure: 255; 255; 0
|
||||
Merged neighbor: 255; 170; 0
|
||||
Name: MapGraph
|
||||
Neighbor: 0; 0; 255
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/mapGraph
|
||||
User: 255; 0; 0
|
||||
Value: true
|
||||
Virtual: 255; 0; 255
|
||||
- Class: rviz_default_plugins/TF
|
||||
Enabled: true
|
||||
Frame Timeout: 15
|
||||
Frames:
|
||||
All Enabled: true
|
||||
base_link:
|
||||
Value: true
|
||||
map:
|
||||
Value: true
|
||||
odom:
|
||||
Value: true
|
||||
zed2_baro_link:
|
||||
Value: true
|
||||
zed2_camera_center:
|
||||
Value: true
|
||||
zed2_imu_link:
|
||||
Value: true
|
||||
zed2_left_camera_frame:
|
||||
Value: true
|
||||
zed2_left_camera_optical_frame:
|
||||
Value: true
|
||||
zed2_mag_link:
|
||||
Value: true
|
||||
zed2_right_camera_frame:
|
||||
Value: true
|
||||
zed2_right_camera_optical_frame:
|
||||
Value: true
|
||||
zed2_temp_left_link:
|
||||
Value: true
|
||||
zed2_temp_right_link:
|
||||
Value: true
|
||||
Marker Scale: 1
|
||||
Name: TF
|
||||
Show Arrows: true
|
||||
Show Axes: true
|
||||
Show Names: false
|
||||
Tree:
|
||||
map:
|
||||
odom:
|
||||
base_link:
|
||||
zed2_camera_center:
|
||||
zed2_baro_link:
|
||||
{}
|
||||
zed2_left_camera_frame:
|
||||
zed2_imu_link:
|
||||
{}
|
||||
zed2_left_camera_optical_frame:
|
||||
{}
|
||||
zed2_temp_left_link:
|
||||
{}
|
||||
zed2_mag_link:
|
||||
{}
|
||||
zed2_right_camera_frame:
|
||||
zed2_right_camera_optical_frame:
|
||||
{}
|
||||
zed2_temp_right_link:
|
||||
{}
|
||||
Update Interval: 0
|
||||
Value: true
|
||||
- Alpha: 0.699999988079071
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: map
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Map
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/map
|
||||
Update Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/map_updates
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: RGB8
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: Odom Local Map
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Points
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /rtabmap/odom_local_map
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: RGB8
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: Camera Cloud
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Points
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /voxel_cloud
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
Enabled: true
|
||||
Global Options:
|
||||
Background Color: 48; 48; 48
|
||||
Fixed Frame: map
|
||||
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
|
||||
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/ThirdPersonFollower
|
||||
Distance: 1.8979769945144653
|
||||
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.09539937227964401
|
||||
Target Frame: base_link
|
||||
Value: ThirdPersonFollower (rviz_default_plugins)
|
||||
Yaw: 3.110400915145874
|
||||
Saved: ~
|
||||
Window Geometry:
|
||||
Displays:
|
||||
collapsed: false
|
||||
Height: 734
|
||||
Hide Left Dock: false
|
||||
Hide Right Dock: false
|
||||
QMainWindow State: 000000ff00000000fd00000004000000000000015600000284fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000284000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000284fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000284000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000003db0000028400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
Selection:
|
||||
collapsed: false
|
||||
Tool Properties:
|
||||
collapsed: false
|
||||
Views:
|
||||
collapsed: false
|
||||
Width: 1335
|
||||
X: 211
|
||||
Y: 105
|
||||
@@ -3,6 +3,8 @@
|
||||
# "stdbuf -o L ros2 launch rtabmap_ros rtabmap.launch.py ..."
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
from launch import LaunchDescription, Substitution, LaunchContext
|
||||
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable, LogInfo, OpaqueFunction
|
||||
from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir, PythonExpression
|
||||
@@ -10,6 +12,7 @@ from launch.conditions import IfCondition, UnlessCondition
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.actions import SetParameter
|
||||
from typing import Text
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
|
||||
#Based on https://answers.ros.org/question/363763/ros2-how-best-to-conditionally-include-a-prefix-in-a-launchpy-file/
|
||||
class ConditionalText(Substitution):
|
||||
@@ -304,9 +307,37 @@ def launch_setup(context, *args, **kwargs):
|
||||
condition=IfCondition(LaunchConfiguration("rtabmapviz")),
|
||||
arguments=[LaunchConfiguration("gui_cfg")],
|
||||
prefix=LaunchConfiguration('launch_prefix'),
|
||||
namespace=LaunchConfiguration('namespace'))]
|
||||
namespace=LaunchConfiguration('namespace')),
|
||||
Node(
|
||||
package='rviz2', executable='rviz2', output='screen',
|
||||
condition=IfCondition(LaunchConfiguration("rviz")),
|
||||
arguments=[["-d"], [LaunchConfiguration("rviz_cfg")]]),
|
||||
Node(
|
||||
package='rtabmap_ros', executable='point_cloud_xyzrgb', output='screen',
|
||||
condition=IfCondition(LaunchConfiguration("rviz")),
|
||||
parameters=[{
|
||||
"decimation": 4,
|
||||
"voxel_size": 0.0,
|
||||
"approx_sync": LaunchConfiguration('approx_sync')
|
||||
}],
|
||||
remappings=[
|
||||
('left/image', LaunchConfiguration('left_image_topic_relay')),
|
||||
('right/image', LaunchConfiguration('right_image_topic_relay')),
|
||||
('left/camera_info', LaunchConfiguration('left_camera_info_topic')),
|
||||
('right/camera_info', LaunchConfiguration('right_camera_info_topic')),
|
||||
('rgb/image', LaunchConfiguration('rgb_topic_relay')),
|
||||
('depth/image', LaunchConfiguration('depth_topic_relay')),
|
||||
('rgb/camera_info', LaunchConfiguration('camera_info_topic')),
|
||||
('rgbd_image', LaunchConfiguration('rgbd_topic_relay')),
|
||||
('cloud', 'voxel_cloud')]),
|
||||
]
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
config_rviz = os.path.join(
|
||||
get_package_share_directory('rtabmap_ros'), 'launch', 'config', 'rgbd.rviz'
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
|
||||
# Arguments
|
||||
@@ -314,13 +345,15 @@ def generate_launch_description():
|
||||
|
||||
DeclareLaunchArgument('localization', default_value='false', description='Launch in localization mode.'),
|
||||
DeclareLaunchArgument('rtabmapviz', default_value='true', description='Launch RTAB-Map UI (optional).'),
|
||||
|
||||
DeclareLaunchArgument('rviz', default_value='false', description='Launch RVIZ (optional).'),
|
||||
|
||||
DeclareLaunchArgument('use_sim_time', default_value='false', description='Use simulation (Gazebo) clock if true'),
|
||||
|
||||
|
||||
# Config files
|
||||
DeclareLaunchArgument('cfg', default_value='', description='To change RTAB-Map\'s parameters, set the path of config file (*.ini) generated by the standalone app.'),
|
||||
DeclareLaunchArgument('gui_cfg', default_value='~/.ros/rtabmap_gui.ini', description='Configuration path of rtabmapviz.'),
|
||||
|
||||
DeclareLaunchArgument('cfg', default_value='', description='To change RTAB-Map\'s parameters, set the path of config file (*.ini) generated by the standalone app.'),
|
||||
DeclareLaunchArgument('gui_cfg', default_value='~/.ros/rtabmap_gui.ini', description='Configuration path of rtabmapviz.'),
|
||||
DeclareLaunchArgument('rviz_cfg', default_value=config_rviz, description='Configuration path of rviz2.'),
|
||||
|
||||
DeclareLaunchArgument('frame_id', default_value='base_link', description='Fixed frame id of the robot (base frame), you may set "base_link" or "base_footprint" if they are published. For camera-only config, this could be "camera_link".'),
|
||||
DeclareLaunchArgument('odom_frame_id', default_value='', description='If set, TF is used to get odometry instead of the topic.'),
|
||||
DeclareLaunchArgument('map_frame_id', default_value='map', description='Output map frame id (TF).'),
|
||||
|
||||
@@ -22,7 +22,9 @@ def generate_launch_description():
|
||||
parameters=[{
|
||||
'frame_id':'base_footprint',
|
||||
'use_sim_time':use_sim_time,
|
||||
'subscribe_depth':True}]
|
||||
'subscribe_depth':True,
|
||||
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
|
||||
}]
|
||||
|
||||
remappings=[
|
||||
('rgb/image', '/intel_realsense_r200_depth/image_raw'),
|
||||
|
||||
@@ -25,8 +25,11 @@ def generate_launch_description():
|
||||
'use_sim_time':use_sim_time,
|
||||
'subscribe_rgbd':True,
|
||||
'subscribe_scan':True,
|
||||
# RTAB-Map's parameters should be strings:
|
||||
'Reg/Strategy':'1',
|
||||
'RGBD/NeighborLinkRefining':'True'}]
|
||||
'RGBD/NeighborLinkRefining':'True',
|
||||
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
|
||||
}]
|
||||
|
||||
remappings=[
|
||||
('rgb/image', '/intel_realsense_r200_depth/image_raw'),
|
||||
|
||||
@@ -26,7 +26,9 @@ def generate_launch_description():
|
||||
'subscribe_scan':True,
|
||||
'approx_sync':True,
|
||||
'Reg/Strategy':'1',
|
||||
'RGBD/NeighborLinkRefining':'True'}]
|
||||
'RGBD/NeighborLinkRefining':'True',
|
||||
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
|
||||
}]
|
||||
|
||||
remappings=[
|
||||
('scan', '/scan')]
|
||||
|
||||
Reference in New Issue
Block a user