Commit 5f8969bb authored by Günter Niemeyer's avatar Günter Niemeyer
Browse files

Added alternate version of depthtolaserscan

This (i) makes sure at least 'minimum_contacts' happen at the closest
range, and (ii) averages those contacts.  This is an attempt to reject
noisy camera data (older RealSense, likely broken).  But I'm not
convinced it is fundamentally better - despite the averaging, the
ranges are tempporally no less stable.
parent 31105024
No related merge requests found
Showing with 758 additions and 0 deletions
+758 -0
...@@ -36,6 +36,7 @@ include_directories( ...@@ -36,6 +36,7 @@ include_directories(
## With catkin_make all packages are built within a single CMake context. ## With catkin_make all packages are built within a single CMake context.
## Make sure the target names don't collide across packages. ## Make sure the target names don't collide across packages.
add_executable(depthtolaserscan src/depthtolaserscan.cpp) add_executable(depthtolaserscan src/depthtolaserscan.cpp)
add_executable(depthtolaserscan2 src/depthtolaserscan2.cpp)
## Add cmake target dependencies of the executable ## Add cmake target dependencies of the executable
## same as for the library above ## same as for the library above
...@@ -43,3 +44,4 @@ add_executable(depthtolaserscan src/depthtolaserscan.cpp) ...@@ -43,3 +44,4 @@ add_executable(depthtolaserscan src/depthtolaserscan.cpp)
## Specify libraries to link a executable target against ## Specify libraries to link a executable target against
target_link_libraries(depthtolaserscan ${catkin_LIBRARIES}) target_link_libraries(depthtolaserscan ${catkin_LIBRARIES})
target_link_libraries(depthtolaserscan2 ${catkin_LIBRARIES})
<launch>
<!-- Show the RealSense converted into a Laser Scan. -->
<!-- URDF parameter. -->
<arg name="urdf" default="bot.urdf"/>
<arg name="model" default="$(find bot_description)/urdf/$(arg urdf)"/>
<!-- Rviz configuration file parameter. -->
<arg name="cfg" default="$(find depthtolaserscan)/rviz/laserscan.rviz"/>
<!-- Load the URDF file into the robot_description parameter. -->
<param name="robot_description" textfile="$(arg model)"/>
<!-- Start the low-level wheelcontrol node -->
<node name="wheelcontrol"
pkg ="example"
type="wheelcontrol.py"
output="screen"
required="true"/>
<!-- Start the odometry node -->
<node name="odometry"
pkg ="example"
type="odometry.py"
output="screen"
required="true"/>
<!-- Start the teleop node SEPARATELY -->
<!--
<node name="teleop"
pkg="shared_demo"
type="teleop.py"
output="screen"/>
-->
<!-- Start the RealSense. I'm not enabling the pointcloud. -->
<!-- A resolution of (-1) implies using the default value. -->
<include file="$(find realsense2_camera)/launch/rs_camera.launch">
<arg name="depth_width" value="-1"/>
<arg name="depth_height" value="-1"/>
<arg name="depth_fps" value="30"/>
<arg name="color_width" value="-1"/>
<arg name="color_height" value="-1"/>
<arg name="color_fps" value="30"/>
<arg name="enable_pointcloud" value="false"/>
<arg name="allow_no_texture_points" value="true"/>
<!-- Replace RS2_STREAM_COLOR with RS_STREAM_ANY to -->
<!-- create the pointcloud without the RGB colors. -->
<arg name="pointcloud_texture_stream" default="RS2_STREAM_COLOR"/>
</include>
<!-- Start the depth image to laser scan conversion. -->
<!-- Note I'm *NOT* using python, it is a LOT slower. -->
<node name="depthtolaserscan"
pkg ="depthtolaserscan"
type="depthtolaserscan2"
output="screen">
<param name="min_height" value="0.030"/>
<param name="max_height" value="0.250"/>
<param name="correction" value="0.000056"/>
<param name="horzsamples" value="-1"/> <!-- -1 = imagewidth/2 = 424 -->
<param name="vertsamples" value="-1"/> <!-- -1 = imageheight/2 = 240 -->
<param name="minimum_contacts" value="5"/>
<param name="similar_fraction" value="0.03"/>
</node>
<!-- Publish all the robot frames. -->
<node name="robot_state_publisher"
pkg ="robot_state_publisher"
type="robot_state_publisher"/>
<!-- Run the rviz visualization, with the specified config file -->
<!-- Kill everything if this stops. -->
<node pkg="rviz"
type="rviz"
name="rviz"
args="-d $(arg cfg)"
output="screen"
required="true"/>
</launch>
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment