Lab1 » Historia » Wersja 7
« Poprzednie -
Wersja 7/23
(diff) -
Następne » -
Obecna wersja
Tomek Winiarski, 2018-06-13 22:25
Lab 1: Introduction to ROS www.ros.org¶
Preparation¶
- Teams are formed
- The tutor adds teams and their members to organization PW-EITI-ANRO-SUMMER-18 on GitHub.
- Introduction to the laboratories.
Scope:¶
- Getting familiar with ROS tutorials (http://wiki.ros.org/ROS/Tutorials)
- Read and follow Core ROS Tutorials->Beginner Level without sections: Getting started with roswtf, Navigating the ROS wiki, Where Next?
- We advise you to type commands instead of copying them from the webpage. This should help you remember them.
- Writing your own ROS package.
- Uploading your results (source code) to GitHub
Detailed hints for ROS Tutorials:¶
- Installing and Configuring Your ROS Environment
- ROS and all needed packages are already installed on computers in the laboratory. You do not have to install anything during the class, but you are welcome to install ROS on your own PC.
- When creating your Catkin workspace (Create a ROS Workspace) use default setting for catkin
- Navigating the ROS Filesystem
- As in the previous tutorial, stick to a single version of Catkin for all tasks.
- ROS package ros-tutorials is already installed in the lab.
- The command roscd log works only if roscore is already running. You can run roscore in another terminal.
- Creating a ROS Package
- Remember to set needed paths using source command with proper arguments (your workspace directory). Use this also in the following tasks/tutorials.
- Do not follow the section package dependencies in the lab.
- The last section, Customizing Your Package is important. You can use any text editor to modify package.xml file (e.g. gedit, vim in terminal). Add to package.xml name of one of members of your team. To build your workspace use catkin_make command (described in the next section). The command should check for errors (at least some of them) in package.xml and CMakeLists.txt files.
- To compile use command catkin_make with proper arguments. You can also use other build commands for catkin, e.g. catkin_make_isolated or catkin tools in default devel mode. However you should stick to one compilation method through the whole course.
- Building a ROS Package
- This section describes build procedure for your package.
- Understanding ROS Nodes
- You can run your Node in this tutorial.
- Understanding ROS Topics
- The graph in rqt_graph differs slightly from the one shown in webpage, but it is okay.
- We use newer distribution of ROS (Kinetic instead of Hydro).
- Video Tutorial can be omitted.
- Understanding ROS Services and Parameters
- To use TAB key autocompletion, begin paths with / key
- Using rqt_console and roslaunch
- Look of some windows differ slightly from tutorial webpage, but it does not matter.
- Using rosed to edit files in ROS
- Default program for editing with rosed can be set using .bashrc file in your home directory.
- Creating a ROS msg and srv
- You should source your setup.bash file in your workspace directory.
- Writing a Simple Publisher and Subscriber (C++)
- Create subscriber and publisher nodes in C++.
- Writing a Simple Publisher and Subscriber (Python)
- Create subscriber and publisher nodes in Python.
- Examining the Simple Publisher and Subscriber
- Console output can differ slightly from the tutorial webpage.
- Writing a Simple Service and Client (C++)
- Create service and client nodes in C++.
- Writing a Simple Service and Client (Python)
- Create service and client nodes in Python.
- Examining the Simple Service and Client
- The same test as in the previous tutorial
- Recording and playing back data
- Topics data can be recorded and played back.
The task:¶
- Update .rosinstall file in your workspace, i.e. add the following line:
git: {local-name: src/anro-TEAM_NAME, uri: 'https://github.com/PW-EITI-ANRO-SUMMER-18/anro-TEAM_NAME.git', version: 'master'}
- If the file is missing, create your workspace using command wstool init
- Pull repositories using command wstool update
- The created repository cannot be empty. If it is empty, you can add README file in GitHub.
- Change current directory to src/anro-TEAM_NAME
- Create a new ROS package in the directory.
- Write a program (in C++ or Python) that controls the turtle:
- The keys used to control the turtle should be different than in tutorial, e.g. g d p l.
- The list of keys that control the turtle should be loaded from ROS parameter server. The server starts automatically with roscore.
- Add roslaunch file, that runs turtle node and control node.
- Test the node and show it to the tutor.
Git repository:¶
- After the node is properly written and works:
- Add all files, except output file using command git add
- Commit local changes using command git commit
- Upload the changes to GitHub server using command git push
- Add wiki page to your repository (the documentation). The page should contain description of source files and instruction for launching. Additionally, add graph and description of structure of the system and communication methods.
- During the presentation to the tutor pull the package from the GitHub server.