ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Is there any way by which robot position gets updated in Navigation Stack?

asked 2022-12-09 07:28:03 -0500

Suraj Singh gravatar image

Hello Everyone,

I'm using ROS Noetic on Ubuntu 20.04 LTS. I have successfully done autonomous navigation of my bot from point A to point B. However, I have a question. My question is:

Since for navigation, we have to define initial pose of bot and 2DNav_goal. Suppose my bot is moving from Point A to B and if I place my bot to Point C so how should bot get to know it present location on it's own? Do we need to use any external Hardware say IMU or GPS etc and EKF package? Presently I'm using RPLidar A1M8 for navigation.

Regards Suraj.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-12-22 07:47:18 -0500

Suraj Singh gravatar image

I am trying to use gmcl for global localisation but before that I'm also trying to use Robot Localisation package so that to avoid any map drifting although my Odometry is correct. I'm trying to fuse wheel Odometry with IMU MPU6050 sensor via robot localization but I'm getting some warnings as shown below:-

Here is my Launch file

<launch>

   <arg name="cmd_vel_topic"                                  default="cmd_vel" />
   <arg name="odom_topic"                                     default="odom" /> 
   <arg name="move_forward_only"                              default="true" />

   <arg name="map_file" default="$(find agv)/maps/mymap8.yaml"/>

   <param name="robot_description" command="cat $(find agv)/urdf/agv.urdf" />

   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

   <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

   <node pkg="tf" type="static_transform_publisher" name="base_link_to_imu_link" args="0.0 0.0 0.30 3.14152 0 0 /base_link /imu_link 10" /> 

   <include file="$(find agv)/launch/drive.launch" />

   <node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"/>

   <include file="$(find agv)/launch/gmcl_diff.launch"/>

   <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
    <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>
    <param name="serial_baudrate"     type="int"    value="115200"/><!--A1/A2 -->
    <!--param name="serial_baudrate"     type="int"    value="256000"--><!--A3 -->
    <param name="frame_id"            type="string" value="laser"/>
    <param name="inverted"            type="bool"   value="false"/>
    <param name="angle_compensate"    type="bool"   value="true"/>
   </node>

   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find agv)/cfg1/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find agv)/cfg1/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find agv)/cfg1/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find agv)/cfg1/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find agv)/cfg1/dwa_local_planner_params.yaml" command="load" />  

    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
    <param name="controller_frequency" value="5.0" />
    <param name="controller_patience" value="15.0" />

           <param name="clearing_rotation_allowed" value="true" /> 
</node>

<node pkg="mpu6050_serial_to_imu" type="mpu6050_serial_to_imu_node" name="mpu6050_serial_to_imu_node" required="true">
       <param name="port" value="/dev/ttyUSB1"/>
           <param name="baud" value="115200"/>
    </node>

    <node name="imu_filter" pkg="imu_complementary_filter" type="complementary_filter_node" >
    </node>

    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_filter_node" clear_params="true">
           <rosparam command="load" file="$(find agv)/cfg/ekf_test.yaml" />
           <remap from="odometry/filtered" to="odom"/>
    </node>

</launch>

Here is my ekf_test.yaml file:

frequency: 10 two_d_mode: true publish_tf: true map_frame: map odom_frame: odom base_link_frame: base_link world_frame: odom

odom0: /odom odom0_config: [false, false, false, false, false, true, true, true, false,
false, false, true, false, false, false,]

odom0_differential: true

imu0: /imu/data imu0_config: [false, false, false, false, false, true, false, false, false, false, false, true, true, false, false,]

imu0_differential: true

Kindly suggest me how to resolve this issue.

ROS Noetic IMU Sensor - MPU6050

Regards Suraj Singh

edit flag offensive delete link more
0

answered 2022-12-15 21:08:22 -0500

Mike Scheutzow gravatar image

updated 2022-12-15 21:09:04 -0500

What you are asking for is called "global localization". Many people use the AMCL package (link) for this, which matches lidar scans to a map.

AMCL assumes that you already have an accurate map, and that your lidar has sufficient range to reach the walls. The implementation in the ros repo is very basic, so be aware you must drive the robot a couple meters before AMCL will estimate the robot's pose on the map.

edit flag offensive delete link more

Comments

How would we implement the same idea but with no walls (outside), GPS, and a preloaded map? I was thinking assigning one corner of the map a specified lat,lon?

chased11 gravatar image chased11  ( 2022-12-15 21:48:26 -0500 )edit

How to implement global_localization if our testing area is beyond the LIDAR range. I'm testing my bot's localization in hall which about 20mx20m. Is there any other way to implement the global localization using some sensors etc.?

Regards Suraj

Suraj Singh gravatar image Suraj Singh  ( 2022-12-15 23:56:29 -0500 )edit

I'm sorry, I forgot to mention that I'm using AMCL for navigation and I've preloaded map saved.

Suraj Singh gravatar image Suraj Singh  ( 2022-12-15 23:58:56 -0500 )edit

Question Tools

Stats

Asked: 2022-12-09 07:28:03 -0500

Seen: 71 times

Last updated: Dec 22 '22