Robotics StackExchange | Archived questions

How to fix laser data that moves with the base_link?

I'm using ROS noetic to develop an autonomous mobile robot. I'm running the navigation stack on raspberry pi 4. when I run the main navigation launch file and set the initial position and the goal point, the robot can't navigate to the goal point, instead, It keeps rotating in its position. when I see the behavior on RVIZ, I see the data of the laser rotates with the robot which doesn't make sense. The odom and the tf are published correctly.

here are more details about the problem (Videos & Screenshots): https://drive.google.com/drive/folders/1buhIEB_cGdCleY2sFsotA5ZwmRbcTswb?usp=sharing

and this is my main launch file:

<launch>
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0 0 0 0 0 0 map odom 20" />
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0.06 0 0.145 0 0 0 base_link laser 30" />

<node name="serial_node" pkg="rosserial_python" type="serial_node.py">
    <param name="port" value="/dev/ttyACM0"/>
    <param name="baud" value="115200"/>
</node>

<node name="ekf_odom_pub" pkg="localization_data_pub" type="ekf_odom_pub">
    <param name="publish_tf" value="true" />
        <param name="publish_rate" value="10.0" />
        <param name="linear_scale_positive" value="1.025" />
        <param name="linear_scale_negative" value="1.025" />
        <param name="angular_scale_positive" value="1.078" />
        <param name="angular_scale_negative" value="1.078" />
    <param name="angular_scale_accel" value="0.0" />
</node> 

<node name="hokuyoNode" pkg="urg_node"  type="urg_node" respawn="false" output="screen">
    <param name="serial_port" type="string" value="/dev/ttyACM1"/>
    <param name="serial_baud" type="int" value="115200"/>
    <param name="frame_id" type="string" value="laser"/>
    <param name="inverted" type="bool" value="false"/>
</node> 

<arg name="map_file" default="/home/pi/catkin_ws/maps/my_map.yaml"/>

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

<include file="$(find amcl)/examples/amcl_diff.launch"/> 

 <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find navstack_pub)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find navstack_pub)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find navstack_pub)/param/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find navstack_pub)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find navstack_pub)/param/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="false" /> 
</node>

</launch>

Asked by Mohammed Saeed on 2023-04-01 05:55:33 UTC

Comments

My guess is that your odometry data is bad, or maybe inconsistent (= the odom topic doesn't match TF odom->base_link data.)

To debug, I would remove amcl and ekf filter, and verify that the base_link pose stays mostly consistent with actual movement of the robot.

Asked by Mike Scheutzow on 2023-04-02 12:15:18 UTC

@mike-scheutzow I've checked the odometry and its fine, I tried to test it with manual control using teleop, to be honest it was getting off a little bit when the robot is turning but overall it's okay.

Asked by Mohammed Saeed on 2023-04-04 17:59:04 UTC

Answers