Localization SLAM how to do?
Hey guys,
I try to develop an autonomous driving car. The problem is that I don't know how to localize the car on my SLAM map.
I only use a LiDAR UTM-30LX LiDAR to navigate. I created successfully a SLAM map with hector mapping.
Now I want to estimate a start point and a goal. I use the navigation stack with move base to navigate. As local planner I have implemented the teb_local_planner because of the Ackermann steering. I can estimate a start point and can set a goal. I also can forward my cmd_vel to the car with a steering angle and a speed info. But the position of the robot on the map in rviz don't change.
Can you help me and tell me what I have to do? I can't start playing around to find a good config for the teb_local_planner like this :(
Here is my launch file:
<launch>
<node pkg="urg_node" type="urg_node" name="urg_node">
<param name="ip_address" type="string" value="192.168.0.10"/>
</node>
<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map"/>
<param name="base_frame" value="base_frame"/>
<param name="odom_frame" value="odom"/>
<node pkg="tf" type="static_transform_publisher" name="map_2_odom" args="0 0 0 0 0 0 /map /odom 100"/>
<node pkg="tf" type="static_transform_publisher" name="odom_2_base_footprint" args="0 0 0 0 0 0 /odom /base_footprint 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_footprint_2_base_link" args="0 0 0 0 0 0 /base_footprint /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_base_stabilized_link" args="0 0 0 0 0 0 /base_link /base_stabilized 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_stablized_2_base_frame" args="0 0 0 0 0 0 /base_stabilized /base_frame 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_2_laser_link" args="0 0 0 0 0 0 /base_frame /laser 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_2_nav_link" args="0 0 0 0 0 0 /base_frame /nav 100"/>
<node pkg="amcl" type="amcl" name="amcl"/>
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find autonomous_car)/launch/costmaps/costmap_common_params.yaml" command="load" ns="global_costmap"/>
<rosparam file="$(find autonomous_car)/launch/costmaps/costmap_common_params.yaml" command="load" ns="local_costmap"/>
<rosparam file="$(find autonomous_car)/launch/costmaps/local_costmap_params.yaml" command="load"/>
<rosparam file="$(find autonomous_car)/launch/costmaps/global_costmap_params.yaml" command="load"/>
<rosparam file="$(find autonomous_car)/launch/costmaps/teb_local_planner_params.yaml" command="load"/>
<param name="clearing_rotation_allowed" value="false"/>
</node>
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find hector_slam_example)/launch/rviz_cfg.rviz"/>
</launch>
My amcl_pose dont update, but the car is moving with the speed and angle from the first input :/
rostopic echo /amcl_pose
header:
seq: 0
stamp:
secs: 1484760781
nsecs: 434161143
frame_id: map
pose:
pose:
position:
x: 1.50654940711
y: 3.46721180218
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.773900494384
w: 0.633307212016
covariance: [0.18227685925353398, 0.0027654181834790847, 0.0, 0.0, 0.0, 0.0, 0.0027654181834790847, 0.22445548719072939, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ...
Not a navigation expert, but I see static TF publishers for important transforms such as
/map
to/odom
and/odom
and/base_footprint
. That seems strange to me, because how do you expect your localisation (you are running one, right?) to update the position of your robot that way?following on @gvdhoorn, are you running AMCL?
So I set the init pose and I set a goal, then the Path the Robot should drive appears. the echo of cmd_vel contains good values. But if I start moving arround the LiDAR the ArrowCloud won't get smaler and also the polygon of the robot does not move
I think I have to reconfigure my whole tf tree... But I don't get it :/