Solidworks really sucks without a geforce card and I would really forget this part.

| PREFACE

Environment
OS: Ubuntu with KDE(the latter is personal interest)
Only Fresh new OS.

Install ROS on Ubuntu is really convenient, comparing with do it on MACOS. Finding supported and alternative dependencies is hard, exactly what happens when you wanna make your own wheel to do something that’s not offically done.
Literaly just type those commands in terminal and it’s done. DAMN, do you have any idea how long I’ve spent on tries to make that work on MACOS? Laziness brings problems, I deserved that.
Well, I’ll do that again sooner or later. A nice guy made a script made that more easily to work with. Thumbs up on that one.

So currently FOXY is on MACOS, as it’s distribution of ROS2, I’ll get into that in another page. Gotta focus on this first.

In short, it mainly mentions cmds below.

1
rospack find [package_name]

it returns the file location of correspoding component.

1
roscd <package-or-stack>[/subdir]

it swith current work directory to where the component, or its subfolder, exists.

1
rosls <package-or-stack>[/subdir]

print all files and folders in the exact folder.

So, intrinsically, it’s modified version of *nix cmd, pretty straightforward.

| ROS PACKAGES

A catkin package consists of

  • Catkin compliant package.xml file
    • which provide meta information about the package
  • CMakeLists.txt which uses catkin

    • If it is a catkin metapackage, it must have the relevent boilerplate file.
  • Each package is placed in its own folder

    • no nested ones sharing the same directory.
1
catkin_create_pkg <package_name> [depend 1] [depend 2] ... [depend n]

This is how we create a new catkin package.

1
rospack depends1 <package_name> // "depends" without 1 to return dependencies recursively

This returns the first-order dependencies.

Words in Description tag should be simplified, keep it short.

Maintainer tag is required and really important. It let others know who to contact about the package.

Normally, you may imagine that catkin_make combines the calls to cmake and make in the standard CMake workflow.

1
2
3
4
5
6
# In a CMake project
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install # (optionally)

This process is run for each CMake project, while catkin projects ( those in the src folder ) can be built together in workspace.

| ROS NODES

A node really isn’t much more than an executable file within a ROS package. ROS nodes use a ROS client library to communicate with other nodes. Nodes can publish or subscribe to a Topic. Nodes can also provide or use a Service.

ROS client libraries allow nodes written in different programming languages to communicate:

  • rospy = python client library
  • roscpp = c++ client library

| ROS TOPICS

rqt_graph creates a dynamic graph of what’s going on in the system. rqt_graph is part of the rqt package. Unless you already have it installed, run:

1
$ rosrun rqt_graph rqt_graph

The rostopic tool allows you to get information about ROS topics.

You can use the help option to get the available sub-commands for rostopic

1
2
3
4
5
6
7
8
$ rostopic -h

rostopic bw display bandwidth used by topic
rostopic echo print messages to screen
rostopic hz display publishing rate of topic
rostopic list print information about active topics
rostopic pub publish data to topic
rostopic type print topic type

Usage:

1
rostopic pub [topic] [msg_type] [args]

For ROS Hydro and later, example:

1
$ rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

| ROS SERVICES

Services are another way that nodes can communicate with each other. Services allow nodes to send a request and receive a response.

1
2
3
4
5
rosservice list         print information about active services
rosservice call call the service with the provided args
rosservice type print service type
rosservice find find services by service type
rosservice uri print service ROSRPC uri

| ROS PARAM

rosparam allows you to store and manipulate data on the ROS Parameter Server. The Parameter Server can store integers, floats, boolean, dictionaries, and lists. rosparam uses the YAML markup language for syntax. In simple cases, YAML looks very natural: 1 is an integer, 1.0 is a float, one is a string, true is a boolean, [1, 2, 3] is a list of integers, and {a: b, c: d} is a dictionary. rosparam has many commands that can be used on parameters, as shown below:

1
2
3
4
5
6
rosparam set            set parameter
rosparam get get parameter
rosparam load load parameters from file
rosparam dump dump parameters to file
rosparam delete delete parameter
rosparam list list parameter names