Robot unable to localize itself

asked 2020-10-06 08:44:52 -0500

Haadi gravatar image

updated 2020-10-10 03:06:57 -0500

I have a robot that uses an RPLIDAR for scanning and an arduino that controls BLDC motor via pwm. I have been able to create a map using GMAPPING, publish odom messages and subscribe my arduino to cmd_vel topic. My arduino calculates the pwm according to the velocity and rotates the wheel. What I am still unable to do is that my robots location doesnot change when I move it around or give it a 2d nav goal. The wheels just keep rotating and robot doesnot stop at the goal.

I URGENTLY NEED HELP I have no idea, what am I doing wrong?

Also, I launched by nox_bringup file and view tf on rviz and the gave i a velocity via TELEOP_KEYBOARD. I saw on rviz that my robot doesnot move straight even when i donot turn it.

these are my launch and yaml files and arduino code P.S. my code is a version of NOX ROBOT available on ROS website nox_navigation.launch:

<arg name="namespace" default=""/> <arg name="tfpre" default="$(arg namespace)"/> <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"> <rosparam file="$(find nox)/cfg/costmap_common_params.yaml" command="load" ns="global_costmap"/> <rosparam file="$(find nox)/cfg/costmap_common_params.yaml" command="load" ns="local_costmap"/> <rosparam file="$(find nox)/cfg/local_costmap_params.yaml" command="load"/> <rosparam file="$(find nox)/cfg/global_costmap_params.yaml" command="load"/> <rosparam file="$(find nox)/cfg/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" /> <!-- Nox is able to rotate in place -->
    <!-- <param name= "allow_none" value="True" /> -->

<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /map /odom 0"/> <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 0"/> <node pkg="gmapping" type="slam_gmapping" name="simple_gmapping" output="screen"> </node>



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

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

<node name="serial_node" pkg="rosserial_python" type=""> </node>

<node name="nox_controller" pkg="nox" type="nox_controller"> </node> <node pkg="tf" type="static_transform_publisher" name="odom_to_laser" args="0.0 0.0 0.3 0.0 0.0 0.0 /odom /laser 0"/> *** Sensors ****
<include file="$(find rplidar_ros)/launch/rplidar.launch"/> </launch>


footprint: [ [-0.27,-0.19], [0.13,-0.19], [0.13,0.19], [-0.27,0.19] ]

transform_tolerance: 0.4 map_type: costmap

obstacle_layer: enabled: true obstacle_range: 5.0 raytrace_range: 5.5 inflation_radius: 0.1 track_unknown_space: false combination_method: 1

observation_sources: laser_scan_sensor laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true}

inflation_layer: enabled: true cost_scaling_factor: 10.0
inflation_radius: 0.1

static_layer: enabled: true map_topic: "map"


global_costmap: global_frame: map robot_base_frame ... (more)

edit retag flag offensive close merge delete


Hi. It is probably because you have a static transform between the map and odom, so it doesn't change: <node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /map /odom 0"/>. Try to comment it. Also, can you run rqt_graph when the system is running and post a screenshot of the graph. Set group to 1, and uncheck Dead sinks and Leaf topics.

tropic gravatar image tropic  ( 2020-10-13 14:32:07 -0500 )edit