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

Turtlebot3 does not move autonomously in Gazebo

asked 2021-01-06 09:25:34 -0500

lyh_lau gravatar image

updated 2021-03-11 00:10:48 -0500

jayess gravatar image

I am trying out the turtlebot tutorial from this website https://automaticaddison.com/how-to-l...

when running this command roslaunch turtlebot3_gazebo turtlebot3_simulation.launch, my turtlebot3 does not move as expected.

After digging some threads in github, I added this line "turtlebot3_drive.init(); in the main function of "turtlebot3_drive.cpp" file

int main(int argc, char* argv[])
{
  ros::init(argc, argv, "turtlebot3_drive");
  Turtlebot3Drive turtlebot3_drive;
  turtlebot3_drive.init();  //the line that I added

  ros::Rate loop_rate(125);

  while (ros::ok())
  {
    turtlebot3_drive.controlLoop();
    ros::spinOnce();
    loop_rate.sleep();
  }

  return 0;
}

The problem still persists, may anyone help me with it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-07 03:05:28 -0500

rodrigo55 gravatar image

Hi,

You can try using a different simulation, like turtlebot3_world.launch which is in the same turtlebot_gazebo package. You must first launch the simulation, then map your environment with roslaunch turtlebot3_slam turtlebot3_slam.launch, save the map with rosrun map_server map_saver, and finally use the launch file roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml. This is all assuming you've cloned ROBOTIS repositories needed for the Turtlebot simulation:

https://github.com/ROBOTIS-GIT/turtle...

https://github.com/ROBOTIS-GIT/turtle...

https://github.com/ROBOTIS-GIT/turtle...

If you want more information, I've created this video that addresses your question:

https://www.youtube.com/watch?v=WCMos...

edit flag offensive delete link more

Comments

I got this error at the last command

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >' [move_base-4] process has died [pid 2852, exit code 1, cmd /opt/ros/melodic/lib/move_base/move_base cmd_vel:=/cmd_vel odom:=odom __name:=move_base __log:=/home/lau/.ros/log/db7b1c5a-50d6-11eb-83dd-0800278352f6/move_base-4.log]. log file: /home/lau/.ros/log/db7b1c5a-50d6-11eb-83dd-0800278352f6/move_base-4*.log

lyh_lau gravatar image lyh_lau  ( 2021-01-07 05:11:16 -0500 )edit

I suspect is the local planner error but I have cloned the navigation package which base,dwa and were included inside

lyh_lau gravatar image lyh_lau  ( 2021-01-07 05:13:02 -0500 )edit

Similar question 1, 2. Have you solve this problem already?

ljaniec gravatar image ljaniec  ( 2022-01-29 08:02:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-01-06 09:25:34 -0500

Seen: 765 times

Last updated: Mar 11 '21