Ros car can't navigate by itself

asked 2019-05-28 13:52:09 -0500

vkea95 gravatar image

updated 2019-05-29 00:27:09 -0500

jayess gravatar image

I setup a robot car with Turtlebot and Rplidar A1 in Ros. I can control the car with keyboard. The car was displayed with correct position in RVIZ. But when I set a goal for it, the car will turn around by itself and then go to the wrong direction. I don't know why it happened. Could anybody help me fix this problem.

OS: ubuntu 1604 ROS: ros-kinetic Source:

In my opinion, there is something wrong in the configuration file. but I can't figure out.

Here are the command list and launch files below.

gnome-terminal -x bash -c "roscore"
sleep 15
gnome-terminal -x bash -c  "roslaunch turtlebot_bringup minimal.launch"
sleep 15
gnome-terminal -x bash -c "roslaunch turtlebot_navigation rplidar_amcl_demo.launch "
sleep 15
gnome-terminal -x bash -c  "rosrun base_controller base_controller"
sleep 15
gnome-terminal -x bash -c  "roslaunch turtlebot_rviz_launchers view_navigation.launch  --screen"


  <!-- Turtlebot -->
  <arg name="base"              default="$(env TURTLEBOT_BASE)"         doc="mobile base type [create, roomba]"/>
  <arg name="battery"           default="$(env TURTLEBOT_BATTERY)"      doc="kernel provided locatio for battery info, use /proc/acpi/battery/BAT0 in 2.6 or earlier kernels." />
  <arg name="stacks"            default="$(env TURTLEBOT_STACKS)"       doc="stack type displayed in visualisation/simulation [circles, hexagons]"/>
  <arg name="3d_sensor"         default="$(env TURTLEBOT_3D_SENSOR)"    doc="3d sensor types [kinect, asux_xtion_pro]"/>
  <arg name="simulation"        default="$(env TURTLEBOT_SIMULATION)"   doc="set flags to indicate this turtle is run in simulation mode."/>
  <arg name="serialport"        default="$(env TURTLEBOT_SERIAL_PORT)"  doc="used by create to configure the port it is connected on [/dev/ttyUSB0, /dev/ttyS0]"/>

  <param name="/use_sim_time" value="$(arg simulation)"/>

  <include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml">
    <arg name="base" value="$(arg base)" />
    <arg name="stacks" value="$(arg stacks)" />
    <arg name="3d_sensor" value="$(arg 3d_sensor)" />
  <include file="$(find turtlebot_bringup)/launch/includes/mobile_base.launch.xml">
    <arg name="base" value="$(arg base)" />
    <arg name="serialport" value="$(arg serialport)" />
  <include unless="$(eval arg('battery') == 'None')" file="$(find turtlebot_bringup)/launch/includes/netbook.launch.xml">
    <arg name="battery" value="$(arg battery)" />



  <!-- Define laser type-->
  <arg name="laser_type" default="rplidar" />

  <!-- laser driver -->
  <include file="$(find turtlebot_navigation)/laser/driver/$(arg laser_type)_laser.launch" />

  <!-- Map server -->
  <arg name="map_file" default="$(env TURTLEBOT_MAP_FILE)"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- AMCL -->
  <arg name="custom_amcl_launch_file" default="$(find turtlebot_navigation)/launch/includes/amcl/$(arg laser_type)_amcl.launch.xml"/>
  <arg name="initial_pose_x" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_y" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_a" default="0.0"/>
  <include file="$(arg custom_amcl_launch_file)">
    <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
    <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
    <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>

  <!-- Move base -->
  <arg name="custom_param_file" default="$(find turtlebot_navigation)/param/$(arg laser_type)_costmap_params.yaml"/>
  <include file="$(find turtlebot_navigation)/launch/includes/rplidar_move_base.launch.xml">
    <arg name="custom_param_file" value="$(arg custom_param_file)"/>


  Used for visualising the turtlebot while building a map or navigating with the ros navistack.
  <node name="rviz" pkg="rviz ...
edit retag flag offensive close merge delete