We are running RTAB map with two web cameras with the following launch file.
<launch>
<!-- Choose visualization -->
<arg name="rviz" default="true" />
<!-- Run the ROS package stereo_image_proc for image rectification and disparity computation -->
<group ns="stereo">
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
<remap from="left/image_raw" to="left/image_raw"/>
<remap from="left/camera_info" to="left/camera_info"/>
<remap from="right/image_raw" to="right/image_raw"/>
<remap from="right/camera_info" to="right/camera_info"/>
<param name="disparity_range" value="128"/>
<param name="approximate_sync" type="bool" value="True"/>
<param name="queue_size" type="int" value="10"/>
</node>
<!-- Disparity to depth -->
<node pkg="nodelet" type="nodelet" name="disparity2depth" args="standalone rtabmap_ros/disparity_to_depth">
<param name="disparity_range" value="128"/>
<param name="approx_sync" type="bool" value="true"/>
<param name="queue_size" type="int" value="100"/>
</node>
</group>
<group ns="rtabmap">
<node pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen">
<remap from="left/image_rect" to="/stereo/left/image_rect_color"/>
<remap from="right/image_rect" to="/stereo/right/image_rect_color"/>
<remap from="left/camera_info" to="/stereo/left/camera_info"/>
<remap from="right/camera_info" to="/stereo/right/camera_info"/>
<param name="subscribe_rgbd" type="bool" value="false"/>
<!-- <remap from="rgbd_image" to="/stereo/rgbd_image"/> -->
<!-- Published topic odom is converted into stereo_odometry -->
<remap from="odom" to="/stereo_odometry"/>
<param name="approx_sync" type="bool" value="true"/>
<param name="frame_id" type="string" value="base_link"/>
<param name="odom_frame_id" type="string" value="odom"/>
<param name="publish_tf" type="bool" value="true"/>
<param name="wait_for_transform" type="string" value="true"/>
<param name="queue_size" type="int" value="100"/>
<param name="Odom/Strategy" type="string" value="0"/> <!-- 0=Frame-to-Map, 1=Frame=to=Frame -->
<param name="Vis/EstimationType" type="string" value="1"/> <!-- 0=3D->3D 1=3D->2D (PnP) -->
<param name="Vis/CorType" value="0"/> <!-- Correspondences: 0=Features Matching, 1=Optical Flow -->
<!-- maximum features map size, default 2000 -->
<param name="OdomF2M/MaxSize" type="string" value="1000"/>
<!-- maximum features extracted by image, default 1000 -->
<param name="Vis/MaxFeatures" type="string" value="600"/>
<param name="Vis/MinInliers" type="string" value="5"/>
<param name="Stereo/MaxDisparity" type="string" value="128"/>
<param name="Stereo/OpticalFlow" type="string" value="false"/>
</node>
<!-- Visual SLAM -->
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<param name="subscribe_depth" type="bool" value="true"/>
<param name="subscribe_rgbd" type="bool" value="false"/>
<param name="subscribe_scan" type="bool" value="false"/>
<remap from="rgb/image" to="/stereo/left/image_rect_color"/>
<remap from="rgb/camera_info" to="/stereo/left/camera_info"/>
<remap from="depth/image" to="/stereo/depth"/>
<remap from="odom" to="/stereo_odometry"/>
<param name="frame_id" type="string" value="/base_link"/>
<param name="queue_size" type="int" value="2000"/>
<param name="approx_sync" type="bool" value="true"/>
<param name="Vis/MinInliers" type="string" value="12"/>
</node>
</group>
<!-- Visualisation RVIZ -->
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find rtabmap_ros)/launch/config/demo_stereo_outdoor.rviz"/>
</launch>
Our TF transform tree has base_link -> stereo/left, base_link -> stereo/right, odom -> base_link
After running rostopic hz stereo/depth stereo/left/image_rect_color stereo/left/camera_info we get the following output as well.
We are new to using rtab map. If someone can offer a help it would be much appreciated.
We finally found the issue. For any of those who are having rtab map odometry or mapping issues with stereo or RGBD sensors like Kinect 360 build RTAB Map from the source.The same launch file worked after the build from source.
Reason for this could be older binaries in the servers.
Guide to manually build rtabmap - Click Here to Build RTAB Map yourself
BTW you can use two USB web cams (YOU DON'T EVEN NEED BRANDED ONES LIKE LOGITECH OURS WERE UNBRANDED CHINESE ONES) as a stereo sensor. You can either sync them using a small code or you can use approx_sync parameter to true. How ever keep in mind that you have to configure TF transformations from base_link to camera_link and camera_link to individual cameras (left and right) as well to make it work. AND BEWARE Sometimes stereo setup like this may not give you a highly accurate map or odometry.
You can also try with a kinect 360 which is really cheap these days.
Related
I'm trying to do an AMCL localization for a pre-created map. AMCL should take laserScan played back from .bag file (containing 2 lasers that are combined into /scan_multi). Issue is that AMCL doesn't seem to do anything, even though odometry works and TF tree should be linked correctly.
Tried also for different initial positions specified from launch file, all of which are correctly represented on map in rviz.
Parts of my launch file that might be relevant:
<arg name="map_file" default="$(find project2)/map/map.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0.0 0.0 0.0 /map /odom 40" />
<node pkg="tf" type="static_transform_publisher" name="odom_to_base_footprint" args="0.0 0.0 0.0 0.0 0.0 0.0 /odom /base_footprint 40" />
<node pkg="tf" type="static_transform_publisher" name="base_footprint_base_link" args="0.0 0.0 0.0 0.0 0.0 0.0 /base_footprint /base_link 40" />
<arg name="scan_topic" default="scan"/>
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>
<node pkg="amcl" type="amcl" name="amcl">
<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_a" value="$(arg initial_pose_a)"/>
<param name="odom_frame_id" value="odom"/>
<param name="base_frame_id" value="base_footprint"/>
<param name="frame_id" value="base_link"/>
<param name="map_frame_id" value="map"/>
<param name="use_map_topic" value="true"/>
<remap from="map" to="/map"/>
<remap from="scan" to="scan_multi"/>
</node>
Structure of TF tree: /map -> /odom -> /base_footprint -> /base_link -> /laser front
I tried using roswtf, got only 1 warning:
The following node subscriptions are unconnected: * /rviz: * /map_updates
Follow here for the whole project: https://drive.google.com/file/d/1AQz4...
Thanks for any help!
Deleting all static transforms from the .launch file and replacing them with a dynamic one between /odom and /base_footprint solved the issue. You can directly use the node from the src folder:
<node pkg="project2" name="odom_tf" respawn="false" type="odom_tf" output="screen"/>
I have been trying to make viso2_ros work with intel realsense r200. But there is a problem with the synchronisation(I think) and viso2_ros is not getting any image data. I get the following warning:
Following is my launch file:
<launch>
<arg name="camera" default="stereo_forward"/> <node ns="$(arg camera)" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/> --> <node pkg="viso2_ros" type="stereo_odometer" name="stereo_odometer" output="screen">
<remap from ="stereo" to="$(arg camera)"/>
<remap from="image" to="image_rect"/>
<remap from="/$(arg camera)/left/image_rect" to="/camera/ir/image_raw"/>
<remap from="/$(arg camera)/left/camera_info" to="/camera/ir/camera_info"/>
<remap from="/$(arg camera)/right/image_rect" to="/camera/ir2/image_raw"/>
<remap from="/$(arg camera)/right/camera_info" to="/camera/ir2/camera_info"/>
<remap from="odom" to="/stereo_odometer/odometry"/>
<param name="queue_size" type="int" value="100"/>
<param name="approximate_sync" type="bool" value="true"/>
<param name="base_link_frame_id" value="$(arg camera)"/>
<param name="odom_frame_id" value="/odom"/>
</node>
</launch>
The rqt_graph:
which does not show a connection for /stereo_forward/right/image_rect. I am using Ubuntu 16.04 with ROS Kinetic. If anyone has any idea or suggestion about a resolution, I would really appreciate that. Thanks in advance!
From a quick google search it looks like Intel R200 only has 1 RGB camera. So I think you'd have to use monocular VO.
I am currently testing several slam algorithms in a real TurtleBot(ROS Kinetic). Despite the fact that everything seems to be working fine on TurtleBot I have come across a problem on the maps coming from odometry based slam algorithms. Although I changed the TurtleBot base to figure out whether the base had hardware or odometry issues, the maps remained the same. The lidar I use has maximum range up to 17m.
Gmapping (using odometry)
I tested gmapping with these parameters:
<launch>
<arg name="scan_topic" default="scan" />
<arg name="base_frame" default="base_footprint"/>
<arg name="odom_frame" default="odom"/>
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<param name="base_frame" value="$(arg base_frame)"/>
<param name="odom_frame" value="$(arg odom_frame)"/>
<param name="map_update_interval" value="5.0"/>
<param name="maxUrange" value="12.0"/>
<param name="maxRange" value="17.0"/>
<param name="sigma" value="0.05"/>
<param name="kernelSize" value="1"/>
<param name="lstep" value="0.05"/>
<param name="astep" value="0.05"/>
<param name="iterations" value="5"/>
<param name="lsigma" value="0.075"/>
<param name="ogain" value="3.0"/>
<param name="lskip" value="0"/>
<param name="minimumScore" value="500"/>
<param name="srr" value="0.01"/>
<param name="srt" value="0.02"/>
<param name="str" value="0.01"/>
<param name="stt" value="0.02"/>
<param name="linearUpdate" value="0.5"/>
<param name="angularUpdate" value="0.436"/>
<param name="temporalUpdate" value="-1.0"/>
<param name="resampleThreshold" value="0.5"/>
<param name="particles" value="200"/>
<param name="xmin" value="-1.0"/>
<param name="ymin" value="-1.0"/>
<param name="xmax" value="1.0"/>
<param name="ymax" value="1.0"/>
<param name="delta" value="0.05"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
The map from Gmapping tested in the whole lab is here:
KartoSlam(using odometry)
The map produced by KartoSlam tested in a lab's room with the default parameters is this.
CRSM Slam (no odometry used)
The map produced by CRSM Slam tested in a lab's room, which does not use odometry is this. As you can see the CRSM map is far better than the previous two.
The questions :
Where shall I look for the fix, since I have tried the algorithms on two different TurtleBots?
How could I improve the map quality, since what I get so far is really poor?
I find that a good way to test the basic odometry is:
Launch the turtlebots with just minimal no gmapping or any other slam.
Start rviz and make sure the fixed frame is set to a world frame like odom or map (verify the name from your TF tree).
Add the laser to it and set a Decay Time of about 100 secs.
Keep the robot infront of a wall and command it to move towards the wall. As the robot moves forward the 'position of the wall' in the laser data in your world frame should look more or less stationery. This gives you the assurance that your forward odometry is ok.
Then put the robot near a corner or someplace where there are big 3D objects in the laser's view. Then command the robot to rotate. Once again all the corners and 3D objects should stay stationary.
If you can do the above successfully then you should be able to make reasonable 'raw' maps before using any SLAM algorithms.
I´m trying to get the value of node in the xml file. I observed that value is wrong. I´m belive that problem is the encoding. Someaone can help me ? below is my code:
In xml File:
<?xml version="1.0" encoding="UTF-8" ?>
<projects>
<project>
<application>Padrão</application> <!-- The problem is the character ~ -->
<name>padrao</name>
<icon>c:\buffer</icon>
<market>br.com.tls.test</market>
</project>
</projects>
My ant code
<xmltask source="config.xml" encoding="UTF-8">
<call path="//project">
<param name="name" path="name/text()" />
<param name="market" path="market/text()" />
<param name="icon" path="icon/text()" />
<param name="application" path="application/text()" />
<actions>
<echo message="#{application}" />
<init-release name="#{name}" market="#{market}" icon="#{icon}" application="#{application}"/>
</actions>
</call>
</xmltask>
Result
[echo]: padr#o
expected
[echo]: padrão
Solution
I changing the file to UTF-8 and I´d sucess in the replace.
I haven't used xmltask, but echo task also has encoding property, have you tried setting that as well?
e.g. <echo message="#{application}" encoding="UTF-8" />
Due to the url length for js resources on my local dev site, it's really annoying to try to find the script I'm looking for.
I'm using combres 2.2.2.4. Here's my relevant combres.xml section:
<jsMinifiers>
<minifier name="msajax" type="Combres.Minifiers.MSAjaxJSMinifier, Combres"
binderType="Combres.Binders.SimpleObjectBinder, Combres">
<param name="CollapseToLiteral" type="bool" value="true" />
<param name="EvalsAreSafe" type="bool" value="true" />
<param name="MacSafariQuirks" type="bool" value="true" />
<param name="CatchAsLocal" type="bool" value="true" />
<param name="LocalRenaming" type="string" value="KeepAll" />
<param name="OutputMode" type="string" value="SingleLine" />
<param name="RemoveUnneededCode" type="bool" value="true" />
<param name="StripDebugStatements" type="bool" value="true" />
</minifier>
<minifier name="yui" type="Combres.Minifiers.YuiJSMinifier, Combres">
<param name="IsVerboseLogging" type="bool" value="false" />
<param name="IsObfuscateJavascript" type="bool" value="true" />
<param name="PreserveAllSemicolons" type="bool" value="false" />
<param name="DisableOptimizations" type="bool" value="false" />
<param name="LineBreakPosition" type="int" value="80" />
</minifier>
</jsMinifiers>
<resourceSets url="~/combres.axd" defaultDuration="30"
defaultVersion="auto"
defaultIgnorePipelineWhenDebug="true"
defaultDebugEnabled="true"
defaultJSMinifierRef="msajax"
defaultCssMinifierRef="yui"
defaultCompressionEnabled="true" >
Any thoughts?
Updates:
I'm still not sure where those hash numbers are coming from. I've jiggled the defaultVersion, defaultVersionGenerator, and version tags of the resources, but I can't seem to see a change.
I've just turned debug off, and I notice that in chrome, it shows
/scripts
/1
indicating that when debug is turned off, the defaultVersion works just as documented, but with debug on, the huge hashes are back. I'm looking into whether it's the version of Combres (we recently updated).
Well, rolled back to 2.1.0.0, and I found the same behavior. It actually might not be Combres here, even though it looks like it should be. I'll continue hunting.
Looks Combres is configured to uses Sha512VersionGenerator (it doesn't show in your config segment, so I suppose that is set in other segments). Try either set versionGenerator of resourceSet (or defaultVersionGenerator of resourceSets, and remember to remove versionGenerator in resourceSet) to:
Combres.VersionGenerators.HashCodeVersionGenerator
Remove the versionGenerator attribute and manually set its version
Proposed by Buu Nguyen:
In Debug mode, the hash generation cannot be "turned off" via Combres configuration. However, it may be possible to modify GetResourceUrl to remove the hash from the Url.