0
$\begingroup$

Rosanswers logo

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, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06599867634852088]


Originally posted by FelixF on ROS Answers with karma: 3 on 2017-01-16

Post score: 0


Original comments

Comment by gvdhoorn on 2017-01-17:
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?

Comment by Procópio on 2017-01-17:
following on @gvdhoorn, are you running AMCL?

Comment by FelixF on 2017-01-17:
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

Comment by FelixF on 2017-01-17:
I think I have to reconfigure my whole tf tree... But I don't get it :/

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

you should use AMCL. it is THE node for localization in ROS. And, as mentioned by @gvdhoorn, you should not publish the tf between /map and /odom, because that is exactly what you want to be published by a localization algoritm (follow the link above on AMCL and check the illustrations on the bottom of the page).


Originally posted by Procópio with karma: 4402 on 2017-01-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by FelixF on 2017-01-17:
please check my comment on top. You are right I deleted this tf, but the porblem is still alive :/

Comment by Procópio on 2017-01-18:
what exactly is your problem? what is the output of the AMCL node?

Comment by FelixF on 2017-01-18:
The Problem is that the position of the car shown in rviz don't update, allthough the car is moving

I aded the amcl_pose to the question

Comment by Procópio on 2017-01-23:
so your amcl pose does not change at all while moving the robot? is it subscribing to the correct scan topic?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.