Skip to content
  • Home
  • About the Blog
  • About the Author
  • Sitemap

Abdur Rosyid's Blog

Just a few notes on mechanical engineering and robotics

ROS1 vs ROS2: What Are Differences?

July 9, 2021 by Abdur Rosyid

The following are some differences between ROS1 and ROS2. Difference 1: Master-Slave vs Distributed Network Architecture ROS1 communication is based on TCPROS (a custom TCP communication) with master-slave network architecture, where one computer/robot should serve as ROS Master while the others serve as slaves. If ROS Master fails, the whole network fails. ROS2 is based …

Continue Reading

Creating ROS2 Action in Python

July 9, 2021 by Abdur Rosyid

Below are the steps to create a ROS2 action using Python. Notice that we are going to have two packages involved: 1) a package called “my_package” which contains the action file, and 2) a package called “action_nodes_python” which contains the action server and client nodes. Separating the package which contains the action file(s) like this, …

Continue Reading

Creating ROS2 Action in C++

July 9, 2021 by Abdur Rosyid

Below are the steps to create a ROS2 action. Notice that we are going to have two packages involved: 1) a package called “my_package” which contains the action file, and 2) a package called “action_nodes_cpp” which contains the action server and client nodes. Separating the package which contains the action file(s) like this, in general, …

Continue Reading

ROS2 Launch File

July 9, 2021 by Abdur Rosyid

In ROS1, we write a launch file in XML. In ROS2, there are three ways to write a launch file: Using Python Using XML Using YAML Since the API of ROS2 launch is written in Python, you have a lower level access to the launch features if you write your launch file in Python. This …

Continue Reading

ROS2 & ROS1 CLI Commands

July 8, 2021 by Abdur Rosyid

The following are some common ROS1 and ROS2 CLI commands: ROS1 ROS2 Function rosrun ros2 run Running a node rosnode ros2 node Information about node rostopic ros2 topic Command for ROS topic roslaunch ros2 launch Command to launch a launch file rosservice ros2 service Command for ROS servide rospack ros2 pkg Information about package

Creating Python Service in ROS2

July 8, 2021 by Abdur Rosyid

Step 1: Create the service (.srv) file, namely ServiceName.srv, inside an “srv” folder. Step 2: Modify setup.py. Step 3: Modify package.xml. Step 4: Write the service_server node in the package subfolder inside the package folder. There are two ways to write a service_server node in Python: 1) old-school approach, and 2) member-function approach. The following …

Continue Reading

Creating C++ Service in ROS2

July 8, 2021 by Abdur Rosyid

Step 1: Create the service (.srv) file, namely ServiceName.srv, inside an “srv” folder.

Step 2: Modify CMakeLists.txt.

Add the following:

1
2
3
4
5
6
7
8
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
 
# and put below before ament_package():
rosidl_generate_interfaces(ros2_exercise_cpp
  "srv/ServiceName.srv"
  DEPENDENCIES builtin_interfaces
)
(more…)
Continue Reading

Writing Python Subscriber in ROS2

July 8, 2021 by Abdur Rosyid

There are three ways to to write a Python publisher in ROS2, namely:

  • Old-school approach
  • Object-oriented (member-function) approach
  • Local function (lambda) approach

Below is an example of each approach to write a Python node listening to “Hello World” stream. The code is taken from here: https://github.com/ros2/examples/tree/foxy/rclpy/topics/minimal_subscriber/examples_rclpy_minimal_subscriber

(more…)
Continue Reading

Writing Python Publisher in ROS2

July 8, 2021 by Abdur Rosyid

There are three ways to to write a Python publisher in ROS2, namely:

  • Old-school approach
  • Object-oriented (member-function) approach
  • Local function approach

Below is an example of each approach to write a Python node publishing “Hello World”. The code is taken from here: https://github.com/ros2/examples/tree/foxy/rclpy/topics/minimal_publisher/examples_rclpy_minimal_publisher

(more…)
Continue Reading

Writing C++ Subscriber in ROS2

July 8, 2021 by Abdur Rosyid

There are three ways to to write a C++ publisher in ROS2, namely:

  • Old-school approach
  • Object-oriented (member-function) approach
  • Local function (lambda) approach

Below is an example of each approach to write a C++ node listening to “Hello World” stream. The code is taken from here: https://github.com/ros2/examples/tree/foxy/rclcpp/topics/minimal_subscriber

(more…)
Continue Reading

Posts navigation

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 12
  • Next

Categories

  • STEM 101
  • Mechanics of Materials
  • Advanced Kinematics
  • Solid Dynamics
  • Finite Element Analysis
  • Fluid Mechanics
  • Thermodynamics
  • Control
  • Robotics
  • Robot Operating System (ROS)
  • Robot Operating System (ROS2)

Recent Posts

  • Developing Teleoperation Node for 1-DOF On-Off Gripper
  • Developing Teleoperation Node for UR Arm
  • Autonomous SLAM Using Explore_Lite in ROS
  • Autonomous SLAM Using Frontier Exploration in ROS
  • Performing SLAM using GMapping in ROS

Archives

  • July 2021
  • June 2021
  • March 2021
  • September 2020
  • April 2020
  • January 2015
  • April 2014
  • March 2014
  • March 2012
  • February 2012
  • June 2011
  • March 2008
© 2025 Abdur Rosyid's Blog | WordPress Theme by Superbthemes