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:
matlabbe
2021-10-05 18:01:30 -04:00
parent fb1200c8f1
commit 16e1c581f4
11 changed files with 860 additions and 233 deletions
+359 -170
View File
@@ -1,173 +1,362 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.250647335"> <storageModule moduleId="org.eclipse.cdt.core.settings">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.250647335" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/> <cconfiguration id="0.250647335">
<extensions>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.250647335" moduleId="org.eclipse.cdt.core.settings" name="Default">
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <externalSettings/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extensions>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions> <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<configuration artifactName="rtabmap-pkg" buildProperties="" description="" id="0.250647335" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.250647335." name="/" resourcePath=""> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1185920931" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1185920931.1819283928" name=""/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<builder arguments="VERBOSE=true -j8" buildPath="${ProjDirPath}/../../build/rtabmap_ros" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.425794023" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1445630059" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1764610277" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.701469504" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"/> <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1724942327" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/> </extensions>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1671812416" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> </storageModule>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1195149217" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.496481855" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"/>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1953247819" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath"> <configuration artifactName="rtabmap-pkg" buildProperties="" description="" id="0.250647335" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/>
</option> <folderInfo id="0.250647335." name="/" resourcePath="">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.747334269" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool> <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1185920931" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<tool id="org.eclipse.cdt.build.core.settings.holder.1906811302" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.1018768267" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"/> <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1185920931.1819283928" name=""/>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1454816819" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/> <builder arguments="VERBOSE=true -j4 install" buildPath="${ProjDirPath}/../../build/rtabmap_ros" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.425794023" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.537988677" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1445630059" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
</tool>
</toolChain> <tool id="org.eclipse.cdt.build.core.settings.holder.1764610277" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
</folderInfo>
<sourceEntries> <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.701469504" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
<entry excluding="build" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="org.eclipse.cdt.build.core.settings.holder.incpaths.1724942327" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
</configuration>
</storageModule> <listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> <listOptionValue builtIn="false" value="/opt/ros/foxy/include"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration> <listOptionValue builtIn="false" value="/usr/include/opencv4"/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <listOptionValue builtIn="false" value="/usr/include/eigen3"/>
<project id="rtabmap-pkg.null.595292537" name="rtabmap-pkg"/>
</storageModule> </option>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default"> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1671812416" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
<resource resourceType="PROJECT" workspacePath="/rtabmap-pkg"/>
</configuration> </tool>
</storageModule>
<storageModule moduleId="scannerConfiguration"> <tool id="org.eclipse.cdt.build.core.settings.holder.1195149217" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.496481855" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="org.eclipse.cdt.build.core.settings.holder.incpaths.1953247819" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<parser enabled="true"/>
</buildOutputProvider> <listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <listOptionValue builtIn="false" value="/opt/ros/foxy/include"/>
<parser enabled="true"/>
</scannerInfoProvider> <listOptionValue builtIn="false" value="/usr/include/opencv4"/>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> <listOptionValue builtIn="false" value="/usr/include/eigen3"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> </option>
<parser enabled="true"/>
</buildOutputProvider> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.747334269" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> </tool>
<parser enabled="true"/>
</scannerInfoProvider> <tool id="org.eclipse.cdt.build.core.settings.holder.1906811302" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.1018768267" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="org.eclipse.cdt.build.core.settings.holder.incpaths.1454816819" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<parser enabled="true"/>
</buildOutputProvider> <listOptionValue builtIn="false" value="/home/labm2414/catkin_ws/devel/include/rtabmap-0.19"/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <listOptionValue builtIn="false" value="/opt/ros/foxy/include"/>
<parser enabled="true"/>
</scannerInfoProvider> <listOptionValue builtIn="false" value="/usr/include/opencv4"/>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> <listOptionValue builtIn="false" value="/usr/include/eigen3"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> </option>
<parser enabled="true"/>
</buildOutputProvider> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.537988677" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> </tool>
<parser enabled="true"/>
</scannerInfoProvider> </toolChain>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> </folderInfo>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <sourceEntries>
<parser enabled="true"/>
</buildOutputProvider> <entry excluding="build" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> </sourceEntries>
<parser enabled="true"/>
</scannerInfoProvider> </configuration>
</profile>
<scannerConfigBuildInfo instanceId="0.250647335"> </storageModule>
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<parser enabled="true"/>
</buildOutputProvider> <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> </cconfiguration>
<parser enabled="true"/>
</scannerInfoProvider> </storageModule>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <project id="rtabmap-pkg.null.595292537" name="rtabmap-pkg"/>
<parser enabled="true"/>
</buildOutputProvider> </storageModule>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> <storageModule moduleId="refreshScope" versionNumber="2">
<parser enabled="true"/>
</scannerInfoProvider> <configuration configurationName="Default">
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> <resource resourceType="PROJECT" workspacePath="/rtabmap-pkg"/>
<buildOutputProvider>
<openAction enabled="true" filePath=""/> </configuration>
<parser enabled="true"/>
</buildOutputProvider> </storageModule>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <storageModule moduleId="scannerConfiguration">
<parser enabled="true"/>
</scannerInfoProvider> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <buildOutputProvider>
<parser enabled="true"/>
</buildOutputProvider> <openAction enabled="true" filePath=""/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> <parser enabled="true"/>
<parser enabled="true"/>
</scannerInfoProvider> </buildOutputProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> <scannerInfoProvider id="specsFile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/> <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</buildOutputProvider> <parser enabled="true"/>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> </scannerInfoProvider>
<parser enabled="true"/>
</scannerInfoProvider> </profile>
</profile>
</scannerConfigBuildInfo> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> <buildOutputProvider>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> <openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="0.250647335">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject> </cproject>
+12 -12
View File
@@ -705,24 +705,24 @@ install(DIRECTORY include/${PROJECT_NAME}/
) )
## Mark other files for installation (e.g. launch and bag files, etc.) ## Mark other files for installation (e.g. launch and bag files, etc.)
install(FILES #install(FILES
launch/ros2/turtlebot3_scan.launch.py # launch/ros2/turtlebot3_scan.launch.py
launch/ros2/turtlebot3_rgbd.launch.py # launch/ros2/turtlebot3_rgbd.launch.py
launch/ros2/turtlebot3_rgbd_sync.launch.py # launch/ros2/turtlebot3_rgbd_sync.launch.py
launch/ros2/realsense_d400.launch.py # launch/ros2/realsense_d400.launch.py
launch/ros2/rtabmap.launch.py # launch/ros2/rtabmap.launch.py
# launch/rgbd_mapping.launch # launch/rgbd_mapping.launch
# launch/stereo_mapping.launch # launch/stereo_mapping.launch
# launch/data_recorder.launch # launch/data_recorder.launch
# launch/rgbd_mapping_kinect2.launch # launch/rgbd_mapping_kinect2.launch
DESTINATION share/${PROJECT_NAME}/launch
)
#install(DIRECTORY
# launch/config
# launch/data
# launch/demo
# DESTINATION share/${PROJECT_NAME}/launch # DESTINATION share/${PROJECT_NAME}/launch
#) #)
install(DIRECTORY
launch/ros2/.
# launch/data
# launch/demo
DESTINATION share/${PROJECT_NAME}/launch
)
## install plugins/nodelets xml ## install plugins/nodelets xml
#install(FILES #install(FILES
+56 -8
View File
@@ -1,7 +1,36 @@
rtabmap_ros [![Build Status](https://github.com/introlab/rtabmap_ros/actions/workflows/ros2.yml/badge.svg)](https://github.com/introlab/rtabmap_ros/actions/workflows/ros2.yml) rtabmap_ros [![Build Status](https://github.com/introlab/rtabmap_ros/actions/workflows/ros2.yml/badge.svg)](https://github.com/introlab/rtabmap_ros/actions/workflows/ros2.yml)
=========== ===========
RTAB-Map's ROS2 package (branch `ros2`). **UNDER CONSTRUCTION**: currently most nodes are ported to ROS2, however they are not all tested yet. The interface is the same than on ROS1 (parameters and topic names should still match ROS1 documentation on [rtabmap_ros](http://wiki.ros.org/rtabmap_ros)). See `launch/ros2` subfolder for some ROS2 examples with turtlebot3 in simulation (requires at least ROS2 Foxy). RTAB-Map's ROS2 package (branch `ros2`). **UNDER CONSTRUCTION**: currently most nodes are ported to ROS2, however they are not all tested yet. The interface is the same than on ROS1 (parameters and topic names should still match ROS1 documentation on [rtabmap_ros](http://wiki.ros.org/rtabmap_ros)).
`rtabmap.launch` is also ported to ROS2 with same arguments. If you see [ROS1 examples](http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping) like this:
```bash
$ roslaunch zed_wrapper zed_no_tf.launch
$ roslaunch rtabmap_ros rtabmap.launch \
rtabmap_args:="--delete_db_on_start" \
rgb_topic:=/zed/zed_node/rgb/image_rect_color \
depth_topic:=/zed/zed_node/depth/depth_registered \
camera_info_topic:=/zed/zed_node/rgb/camera_info \
frame_id:=base_link \
approx_sync:=false
```
The ROS2 equivalent is (with those [lines](https://github.com/stereolabs/zed-ros2-wrapper/blob/b512dce6ad4565f4770273995b147122e735ca0f/zed_wrapper/config/common.yaml#L58-L60) set to false to avoid TF conflicts):
```bash
$ ros2 launch zed_wrapper zed.launch.py
$ ros2 launch rtabmap_ros rtabmap.launch.py \
rtabmap_args:="--delete_db_on_start" \
rgb_topic:=/zed/zed_node/rgb/image_rect_color \
depth_topic:=/zed/zed_node/depth/depth_registered \
camera_info_topic:=/zed/zed_node/rgb/camera_info \
frame_id:=base_link \
approx_sync:=false
```
# Installation # Installation
@@ -14,11 +43,30 @@ RTAB-Map's ROS2 package (branch `ros2`). **UNDER CONSTRUCTION**: currently most
$ colcon build $ colcon build
``` ```
# Example # Example with Turtlebot3
```bash
$ export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/ros2_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models
$ export TURTLEBOT3_MODEL=waffle
$ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
$ ros2 launch rtabmap_ros turtlebot3_scan.launch.py
```
1. Launch Turtlebot3 simulator:
```bash
$ export TURTLEBOT3_MODEL=waffle
$ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
$ export TURTLEBOT3_MODEL=waffle
$ ros2 run turtlebot3_teleop teleop_keyboard
```
2. Launch RTAB-Map:
```
$ ros2 launch rtabmap_ros turtlebot3_scan.launch.py
# OR with rtabmap.launch.py
$ ros2 launch rtabmap_ros rtabmap.launch.py \
visual_odometry:=false \
frame_id:=base_footprint \
subscribe_scan:=true depth:=false \
approx_sync:=true \
odom_topic:=/odom \
scan_topic:=/scan \
args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1" \
use_sim_time:=true
```
See [launch/ros2](https://github.com/introlab/rtabmap_ros/tree/ros2/launch/ros2) subfolder for some other ROS2 examples with turtlebot3 in simulation and a RGB-D camera.
+339
View File
@@ -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
+36 -3
View File
@@ -3,6 +3,8 @@
# "stdbuf -o L ros2 launch rtabmap_ros rtabmap.launch.py ..." # "stdbuf -o L ros2 launch rtabmap_ros rtabmap.launch.py ..."
# #
import os
from launch import LaunchDescription, Substitution, LaunchContext from launch import LaunchDescription, Substitution, LaunchContext
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable, LogInfo, OpaqueFunction from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable, LogInfo, OpaqueFunction
from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir, PythonExpression 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 Node
from launch_ros.actions import SetParameter from launch_ros.actions import SetParameter
from typing import Text 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/ #Based on https://answers.ros.org/question/363763/ros2-how-best-to-conditionally-include-a-prefix-in-a-launchpy-file/
class ConditionalText(Substitution): class ConditionalText(Substitution):
@@ -304,9 +307,37 @@ def launch_setup(context, *args, **kwargs):
condition=IfCondition(LaunchConfiguration("rtabmapviz")), condition=IfCondition(LaunchConfiguration("rtabmapviz")),
arguments=[LaunchConfiguration("gui_cfg")], arguments=[LaunchConfiguration("gui_cfg")],
prefix=LaunchConfiguration('launch_prefix'), 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(): def generate_launch_description():
config_rviz = os.path.join(
get_package_share_directory('rtabmap_ros'), 'launch', 'config', 'rgbd.rviz'
)
return LaunchDescription([ return LaunchDescription([
# Arguments # Arguments
@@ -314,12 +345,14 @@ def generate_launch_description():
DeclareLaunchArgument('localization', default_value='false', description='Launch in localization mode.'), DeclareLaunchArgument('localization', default_value='false', description='Launch in localization mode.'),
DeclareLaunchArgument('rtabmapviz', default_value='true', description='Launch RTAB-Map UI (optional).'), 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'), DeclareLaunchArgument('use_sim_time', default_value='false', description='Use simulation (Gazebo) clock if true'),
# Config files # 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('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('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('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('odom_frame_id', default_value='', description='If set, TF is used to get odometry instead of the topic.'),
+3 -1
View File
@@ -22,7 +22,9 @@ def generate_launch_description():
parameters=[{ parameters=[{
'frame_id':'base_footprint', 'frame_id':'base_footprint',
'use_sim_time':use_sim_time, 'use_sim_time':use_sim_time,
'subscribe_depth':True}] 'subscribe_depth':True,
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}]
remappings=[ remappings=[
('rgb/image', '/intel_realsense_r200_depth/image_raw'), ('rgb/image', '/intel_realsense_r200_depth/image_raw'),
+4 -1
View File
@@ -25,8 +25,11 @@ def generate_launch_description():
'use_sim_time':use_sim_time, 'use_sim_time':use_sim_time,
'subscribe_rgbd':True, 'subscribe_rgbd':True,
'subscribe_scan':True, 'subscribe_scan':True,
# RTAB-Map's parameters should be strings:
'Reg/Strategy':'1', 'Reg/Strategy':'1',
'RGBD/NeighborLinkRefining':'True'}] 'RGBD/NeighborLinkRefining':'True',
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}]
remappings=[ remappings=[
('rgb/image', '/intel_realsense_r200_depth/image_raw'), ('rgb/image', '/intel_realsense_r200_depth/image_raw'),
+3 -1
View File
@@ -26,7 +26,9 @@ def generate_launch_description():
'subscribe_scan':True, 'subscribe_scan':True,
'approx_sync':True, 'approx_sync':True,
'Reg/Strategy':'1', 'Reg/Strategy':'1',
'RGBD/NeighborLinkRefining':'True'}] 'RGBD/NeighborLinkRefining':'True',
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}]
remappings=[ remappings=[
('scan', '/scan')] ('scan', '/scan')]
+4
View File
@@ -3333,6 +3333,10 @@ void CoreWrapper::getMapDataCallback(
res->data.header.stamp = now(); res->data.header.stamp = now();
res->data.header.frame_id = mapFrameId_; res->data.header.frame_id = mapFrameId_;
RCLCPP_INFO(this->get_logger(), "rtabmap: Getting map (global=%s optimized=%s graphOnly=%s)...done!",
req->global_map?"true":"false",
req->optimized?"true":"false",
req->graph_only?"true":"false");
} }
void CoreWrapper::getMapData2Callback( void CoreWrapper::getMapData2Callback(
+6 -2
View File
@@ -323,11 +323,15 @@ void PointCloudXYZRGB::stereoCallback(
if(!(imageLeft->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0 || if(!(imageLeft->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0 ||
imageLeft->encoding.compare(sensor_msgs::image_encodings::MONO16) == 0 || imageLeft->encoding.compare(sensor_msgs::image_encodings::MONO16) == 0 ||
imageLeft->encoding.compare(sensor_msgs::image_encodings::BGR8) == 0 || imageLeft->encoding.compare(sensor_msgs::image_encodings::BGR8) == 0 ||
imageLeft->encoding.compare(sensor_msgs::image_encodings::RGB8) == 0) || imageLeft->encoding.compare(sensor_msgs::image_encodings::RGB8) == 0 ||
imageLeft->encoding.compare(sensor_msgs::image_encodings::RGBA8) == 0 ||
imageLeft->encoding.compare(sensor_msgs::image_encodings::BGRA8) == 0) ||
!(imageRight->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0 || !(imageRight->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0 ||
imageRight->encoding.compare(sensor_msgs::image_encodings::MONO16) == 0 || imageRight->encoding.compare(sensor_msgs::image_encodings::MONO16) == 0 ||
imageRight->encoding.compare(sensor_msgs::image_encodings::BGR8) == 0 || imageRight->encoding.compare(sensor_msgs::image_encodings::BGR8) == 0 ||
imageRight->encoding.compare(sensor_msgs::image_encodings::RGB8) == 0)) imageRight->encoding.compare(sensor_msgs::image_encodings::RGB8) == 0 ||
imageRight->encoding.compare(sensor_msgs::image_encodings::RGBA8) == 0 ||
imageRight->encoding.compare(sensor_msgs::image_encodings::BGRA8) == 0))
{ {
RCLCPP_ERROR(this->get_logger(), "Input type must be image=mono8,mono16,rgb8,bgr8 (enc=%s)", imageLeft->encoding.c_str()); RCLCPP_ERROR(this->get_logger(), "Input type must be image=mono8,mono16,rgb8,bgr8 (enc=%s)", imageLeft->encoding.c_str());
return; return;
+35 -32
View File
@@ -197,7 +197,6 @@ MapCloudDisplay::MapCloudDisplay()
download_graph_ = new rviz_common::properties::BoolProperty( "Download graph", false, download_graph_ = new rviz_common::properties::BoolProperty( "Download graph", false,
"Download the optimized global graph (without cloud data) using rtabmap/GetMap service.", "Download the optimized global graph (without cloud data) using rtabmap/GetMap service.",
this, SLOT( downloadGraph() ), this ); this, SLOT( downloadGraph() ), this );
downloadNamespaceChanged();
} }
@@ -210,6 +209,8 @@ void MapCloudDisplay::onInitialize()
updateStyle(); updateStyle();
updateBillboardSize(); updateBillboardSize();
updateAlpha(); updateAlpha();
downloadNamespaceChanged();
} }
void MapCloudDisplay::loadTransformers() void MapCloudDisplay::loadTransformers()
@@ -492,56 +493,60 @@ void MapCloudDisplay::downloadMap(bool graphOnly)
{ {
RCLCPP_ERROR(rviz_ros_node_.lock()->get_raw_node()->get_logger(), "MapCloud plugin: DownloadMap still not working on ros2"); RCLCPP_ERROR(rviz_ros_node_.lock()->get_raw_node()->get_logger(), "MapCloud plugin: DownloadMap still not working on ros2");
return; return;
// FIXME: ros2 seg fault: // FIXME: ros2: can connect to client, rtabmap returns data but the callback here is never called?!
/* /*
auto request = std::make_shared<rtabmap_ros::srv::GetMap::Request>(); auto request = std::make_shared<rtabmap_ros::srv::GetMap::Request>();
request->global = true; request->global_map = false;
request->optimized = true; request->optimized = true;
request->graph_only = graphOnly; request->graph_only = graphOnly;
std::string rtabmapNs = download_namespace->getStdString(); std::string rtabmapNs = download_namespace->getStdString();
std::string srvName = uFormat("%s/get_map_data", rtabmapNs.c_str()); std::string srvName = uFormat("%s/get_map_data", rtabmapNs.c_str());
QMessageBox * messageBox = new QMessageBox( // QMessageBox * messageBox = new QMessageBox(
QMessageBox::NoIcon, // QMessageBox::NoIcon,
tr("Calling \"%1\" service...").arg(srvName.c_str()), // tr("Calling \"%1\" service...").arg(srvName.c_str()),
tr("Downloading the map... please wait (rviz could become gray!)"), // tr("Downloading the map... please wait (rviz could become gray!)"),
QMessageBox::NoButton); // QMessageBox::NoButton);
messageBox->setAttribute(Qt::WA_DeleteOnClose, true); // messageBox->setAttribute(Qt::WA_DeleteOnClose, true);
messageBox->show(); // messageBox->show();
QApplication::processEvents(); // QApplication::processEvents();
uSleep(100); // hack make sure the text in the QMessageBox is shown... // uSleep(100); // hack make sure the text in the QMessageBox is shown...
QApplication::processEvents(); // QApplication::processEvents();
RVIZ_COMMON_LOG_WARNING(uFormat("Wait for service %s", srvName.c_str()));
auto client = rviz_ros_node_.lock()->get_raw_node()->create_client<rtabmap_ros::srv::GetMap>(srvName); auto client = rviz_ros_node_.lock()->get_raw_node()->create_client<rtabmap_ros::srv::GetMap>(srvName);
if(client->wait_for_service(std::chrono::seconds(2))) if(client->wait_for_service(std::chrono::seconds(1)))
{ {
using ServiceResponseFuture = using ServiceResponseFuture = rclcpp::Client<rtabmap_ros::srv::GetMap>::SharedFuture;
rclcpp::Client<rtabmap_ros::srv::GetMap>::SharedFuture; auto response_received_callback = [this, &graphOnly](ServiceResponseFuture future) {
auto response_received_callback = [this, &graphOnly, &messageBox](ServiceResponseFuture future) {
auto result = future.get(); auto result = future.get();
RVIZ_COMMON_LOG_WARNING(uFormat("Process data"));
if(graphOnly) if(graphOnly)
{ {
messageBox->setText(tr("Updating the map (%1 nodes downloaded)...").arg(result->data.graph.poses.size())); //messageBox->setText(tr("Updating the map (%1 nodes downloaded)...").arg(result->data.graph.poses.size()));
QApplication::processEvents(); //QApplication::processEvents();
processMapData(result->data); processMapData(result->data);
messageBox->setText(tr("Updating the map (%1 nodes downloaded)... done!").arg(result->data.graph.poses.size())); //messageBox->setText(tr("Updating the map (%1 nodes downloaded)... done!").arg(result->data.graph.poses.size()));
QTimer::singleShot(1000, messageBox, SLOT(close())); // QTimer::singleShot(1000, messageBox, SLOT(close()));
} }
else else
{ {
messageBox->setText(tr("Creating all clouds (%1 poses and %2 clouds downloaded)...") //messageBox->setText(tr("Creating all clouds (%1 poses and %2 clouds downloaded)...")
.arg(result->data.graph.poses.size()).arg(result->data.nodes.size())); // .arg(result->data.graph.poses.size()).arg(result->data.nodes.size()));
QApplication::processEvents(); //QApplication::processEvents();
this->reset(); this->reset();
processMapData(result->data); processMapData(result->data);
messageBox->setText(tr("Creating all clouds (%1 poses and %2 clouds downloaded)... done!") //messageBox->setText(tr("Creating all clouds (%1 poses and %2 clouds downloaded)... done!")
.arg(result->data.graph.poses.size()).arg(result->data.nodes.size())); // .arg(result->data.graph.poses.size()).arg(result->data.nodes.size()));
QTimer::singleShot(1000, messageBox, SLOT(close())); // QTimer::singleShot(1000, messageBox, SLOT(close()));
} }
}; };
RVIZ_COMMON_LOG_WARNING(uFormat("Calling service %s", srvName.c_str()));
auto result_future = client->async_send_request(request, response_received_callback); auto result_future = client->async_send_request(request, response_received_callback);
RVIZ_COMMON_LOG_WARNING(uFormat("Wait"));
result_future.wait(); result_future.wait();
RVIZ_COMMON_LOG_WARNING(uFormat("Wait end"));
} }
else else
{ {
@@ -551,17 +556,15 @@ void MapCloudDisplay::downloadMap(bool graphOnly)
srvName.c_str(), srvName.c_str(),
rtabmapNs.c_str()); rtabmapNs.c_str());
RVIZ_COMMON_LOG_ERROR(msg); RVIZ_COMMON_LOG_ERROR(msg);
messageBox->setText(msg.c_str()); //messageBox->setText(msg.c_str());
} }*/
*/
} }
void MapCloudDisplay::downloadNamespaceChanged() void MapCloudDisplay::downloadNamespaceChanged()
{ {
std::string rtabmapNs = download_namespace->getStdString(); std::string rtabmapNs = download_namespace->getStdString();
std::string topicName = uFormat("%s/republish_node_data", rtabmapNs.c_str()); std::string topicName = uFormat("%s/republish_node_data", rtabmapNs.c_str());
// FIXME: ros2 seg fault: republishNodeDataPub_ = rviz_ros_node_.lock()->get_raw_node()->create_publisher<std_msgs::msg::Int32MultiArray>(topicName, 1);
//republishNodeDataPub_ = rviz_ros_node_.lock()->get_raw_node()->create_publisher<std_msgs::msg::Int32MultiArray>(topicName, 1);
} }
void MapCloudDisplay::downloadMap() void MapCloudDisplay::downloadMap()