Skip to content

Latest commit

 

History

History
48 lines (27 loc) · 5.76 KB

resources.md

File metadata and controls

48 lines (27 loc) · 5.76 KB

Useful resources to get started

Git

This git tutorial is good for getting an intuition about how git works. Although there is one important difference - instead of using forks (which are your "version" of the entire repository), we are using branches (a different "version" of the code, stored in the same repository). This guide is a bit more information on them, as well as another decent explanation of how git works.

ROS2

In this section, I will give you a brief explanation of how ROS2 works; once you realise that you need to use a particular feature, it is a good idea to get familiar with how it can be implemented through the ROS2 Tutorials. Please use Python, not C++.

Please make sure that you are looking at "Jazzy" wiki pages, and not "Humble", "Noetic", "Rolling", etc. when looking at online resources.

And finally, I recommend having a look at existing code in the RobotArmPackages2 repository for examples for consistency in the way we implement things.

A brief overview of ROS2

ROS2 provides a way to split code into packages and let these packages communicate with one another.

Please briefly read the glossary below so that you know what features are available in ROS2.

Glossary

Code structure

node: a separate chunk of code that can be run by itself. For example, a node interfacing with the camera and publishing its images onto a topic, a node reading camera information and publishing the location of the board, etc.

package: a chunk of code that is thematically related; contains multiple nodes; could be written by us, provided by ROS2 out-of-the-box or installed via rosdep

Workspace: corresponds to the RobotArmPackages2 repo; is a collection of packages (under src/) and instructions on how to combine them

Communication between nodes

topic: a "channel" on which messages can be published by publishers and read by subscribers. Useful for e.g. sending streams of data between nodes, such as camera data. Especially useful if we need multiple subscribers per publisher (e.g. many nodes need the camera image). Here is a code example. Some data, e.g. Images or numbers, has built-in message types; for custom data, you will need to create your own.

service: a way to request information from/run function from a different node. Use only with functions which compute quickly (e.g. update settings); use actions if the function takes a long time to complete. Here is a code example. You will most likely need to create your own service format to be able to send the data.

action: a way to call long-running function (e.g. telling motors to move to a position). Unlike services, provides continuous feedback to the caller and allows the caller to cancel the action. Here is a code example. You will need to create your own action

parameters: a way to customise behaviour of a node (e.g. selecting which camera to use). To set the parameters of the node when starting it, use --ros-args -p param1:=value1 param2:=value2

Tools

colcon: a tool that is used to build and test packages.

Launch files: let you specify how to start multiple nodes at the same time, automatically. Here is some more information.

ros2: the main tool used in ROS2; can be used to run nodes, look up information on packages/actions/topics/etc.

rosdep: a tool that manages automatically installing ROS2 packages from the internet

rqt: A graphical tool for working with ROS2; can do things like visualising messages on topics. You can e.g. view logs or visualise topic messages.

rviz: A tool used to run 3D simulations of the robot