Re: Localization issue
Posted by
aviadoz on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Localization-issue-tp5847p5864.html
Hi Mathieu,
So, I made a video which describe my issue.
I have a previous map with DetectRate = 0, my odom>base_link was published by node which I created and not from another pkg or robot_localization for example.
Here my launch file:
<?xml version="1.0"?>
<launch>
<arg name="vo" default="false" />
<arg name="amcl" default="false" />
<arg name="move_base" default="true" />
<arg name="mapping" default="false" />
<arg name="outdoor" default="false" />
<arg name="urdf" default="false" />
<!--load platform 3d model-->
<include if="$(arg urdf)" file="$(find arl_description)/launch/newurdf.launch" />
<!--<node pkg="tf" type="static_transform_publisher" name="map_odom" args="0 0 0 0 0 0 map odom 30" />
<node pkg="tf" type="static_transform_publisher" name="odom_base_footprint" args="0 0 0 0 0 0 odom base_footprint 30" />-->
<!--<node pkg="tf" type="static_transform_publisher" name="base1" args="0 0 0 0 0 0 base_footprint base_link 30" />-->
<!-- bringup realsense camera -->
<include file="$(find realsense2_camera)/launch/rs_camera.launch"/>
<!--outdoor configuration for realsense-->
<node if="$(arg outdoor)" name="dynamic_reconfigure_load" pkg="dynamic_reconfigure" type="dynparam" args="load /camera/realsense2_camera_manager $(find realsense2_camera)/launch/includes/test_yaml.yaml" >
</node>
<!--camera tf-->
<node pkg="tf" type="static_transform_publisher" name="camera_link_arl" args="0.15 0 0.2 0 0 0 base_link camera_link 30" />
<!-- Laser topic -->
<node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan">
<remap from="image" to="/camera/depth/image_rect_raw"/>
<remap from="camera_info" to="/camera/depth/camera_info"/>
<param name="range_min" value="0.1"/>
<param name="range_max" value="5"/>
<!--<param name="frame_id" value="camera_link" />-->
</node>
<!-- Arduino connection -->
<node pkg="rosserial_python" type="serial_node.py" name="serial_node">
<param name="port" value="/dev/ttyACM0"/>
<param name="baud" value="57600"/>
</node>
<!-- encoders odometry -->
<node unless="$(arg vo)" pkg="arl_description" type="physical_odometry" name="physical_odometry" output="screen"/>
<!-- efk for localization
<include file="$(find robot_localization)/launch/ekf_template.launch" />-->
<!--load rtabmap mapping
<include file="$(find arl_description)/launch/rtabmap_realsense.launch" unless="$(arg amcl)" >-->
<include file="$(find arl_description)/launch/rtabmap_realsense.launch" output="screen" >
<arg name="vo" default="$(arg vo)" />
<arg name="mapping" value="$(arg mapping)" />
<arg if="$(arg mapping)" name="localization" value="false" />
<arg unless="$(arg mapping)" name="localization" value="true" />
<arg name="rtabmapviz" default="false" />
<arg name="rviz" default="true" />
<arg name="frame_id" value="base_link" />
<arg name="rgb_topic" default="/camera/color/image_raw" />
<arg name="depth_topic" default="/camera/depth/image_rect_raw" /><!--was aligned-->
<arg name="camera_info_topic" default="/camera/color/camera_info" />
</include>
<!-- ROS navigation stack move_base -->
<node if="$(arg move_base)" pkg="move_base" type="move_base" respawn="true" name="move_base" output="screen">
<!-- <param name="base_global_planner" value="global_planner/GlobalPlanner"/>
<rosparam file="$(find arl_description)/launch/nav_data/global_planner_params.yaml" command="load" />-->
<param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS" />
<!--<rosparam file="$(find arl_description)/launch/nav_data/planner.yaml" command="load"/>
<rosparam file="$(find arl_description)/launch/nav_data/dwa_local_planner.yaml" command="load" />
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
<rosparam file="$(find arl_description)/launch/nav_data/dwa_local_planner_params.yaml" command="load" />-->
<rosparam file="$(find arl_description)/launch/nav_data/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find arl_description)/launch/nav_data/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find arl_description)/launch/nav_data/local_costmap_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find arl_description)/launch/nav_data/global_costmap_params.yaml" command="load" ns="global_costmap"/>
<rosparam file="$(find arl_description)/launch/nav_data/base_local_planner_params.yaml" command="load" />
<param name="recovery_behavior_enabled" value="false" />
<remap from="cmd_vel" to="cmd_vel"/>
<remap from="odom" to="odom"/>
<!--<remap from="move_base_simple/goal" to="rtabmap/goal"/>-->
<remap from="scan" to="scan"/>
<remap from="map" to="/grid_map"/>
</node>
<!--AMCL-->
<node if="$(arg amcl)" pkg="amcl" type="amcl" name="amcl" >
<remap from="map" to="/grid_map"/>
<!--<remap from="initialpose" to="/localization_pose"/>-->
<param name="odom_model_type" value="diff" />
<param name="odom_frame_id" value="odom" />
<!-- <param name="global_frame_id" value="odom"/>-->
<param name="base_frame_id" value="base_link"/>
<param name="use_map_topic" value="true"/>
<param name="tf_broadcast" value="false"/>
</node>
<arg name="rviz_cfg" default="$(find arl_description)/launch/realsenseARL.rviz" />
<!--<node if="$(arg amcl)" pkg="rviz" type="rviz" name="rviz" args="-d $(arg rviz_cfg)"/>-->
</launch>
VIDEO also, I decrease the controller frequency parameter to 1.
Here it is one more video which describe the jumps of the robot (in localization mode and after a little driving)
https://www.youtube.com/watch?v=IkXk45l28t0 Thank you