It is a continuation from Try running ROS sample easily on a virtual machine. Let's run Kobuki (a robot like Rumba) 3D simulator in Gazebo. (The black one in ↓ moves) Finally, I'm becoming more like a robot.
I installed it to the end and started it, but the version did not match and I could not start it. Refer to the following and add and update the repository first. Reference: Problem with Indigo and Gazebo 2.2 --ROS Answers: Open Source Q & A Forum
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu trusty main" > /etc/apt/sources.list.d/gazebo-latest.list'
$ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install -y ros-indigo-kobuki-gazebo
At the end, it starts all at once, so for now, just check the commands.
$ roslaunch kobuki_gazebo kobuki_playground.launch
Create a package template as follows. kobuki_sample
is arbitrary because it is the name of the package to be created. rospy
and std_msgs
specify dependent packages, but you can add them later so you don't have to worry too much.
$ cd ~/catkin_ws/src
$ catkin_create_pkg kobuki_sample rospy std_msgs
catkin_make
$ cd ~/catkin_ws
$ catkin_make
$ source ~/catkin_ws/devel/setup.bash
It seems to be a good idea to put the source code under <package> / scripts
.
$ mkdir -p ~/catkin_ws/src/kobuki_sample/scripts
$ roscd kobuki_sample/scripts
$ vi sample.py
The program below is a slightly modified version of the program in the following books. By the way, it is a BSD license. Amazon is highly rated, and it's actually an easy-to-read and easy-to-understand introductory book. Recommended.
td> | Robot programming started with ROS-a "framework" for free robots ( I ・ O BOOKS) Takashi Ogura Engineering Co., Ltd. 2015-06-25 Sales Ranking: 15436 See details on Amazon font> by G-Tools font> td> tr> > table>
|