Using Services in ROS 2

Understand ROS 2 services and how they provide request-response communication between nodes.
Blog>
using-services-in-ros-2
Last updated: 
June 29, 2025

Ever wish your robot would just answer a straight question for once? Like, “Hey, can you reset the simulation?” or “Where exactly is your elbow joint right now?” That’s where ROS 2 services come in. A service allows one node to send a request and receive a direct response — making it ideal for operations that require precise control or confirmation. This pattern is especially useful in Isaac Sim when executing discrete actions such as resetting the environment, spawning a new robot, or retrieving the exact state of a simulated component.

🛎️ ROS 2 Services: Request-Response Control in Isaac Sim

ROS 2 services are ideal when you need an operation to complete before moving forward. In Isaac Sim, services enable precise, one-time commands that make simulation workflows more deterministic and testable.

Unlike topics, which are designed for continuous, asynchronous data streams (like a live camera feed or velocity command), services offer synchronous, request-response communication. One node sends a request, and the server node replies with a result — similar to calling a function and getting a return value.

This pattern is particularly useful in Isaac Sim, where simulations often require control over state transitions, scene resets, or environmental queries. Services make it easy to trigger specific actions or retrieve exact simulation data at a given point in time.

Here’s how services fit into your Isaac Sim workflow:

  • Resetting the World: A node can call a service like /reset_simulation to bring the scene back to its initial state — helpful for testing repeated scenarios.
  • Spawning/Deleting Robots: Call a service to load or remove robot assets programmatically during simulation.
  • Querying Robot State: Use services to get precise data like joint angles, link positions, or simulation time — useful for logging or debugging.
  • Triggering Events: Need to simulate a button press or trigger a specific sensor condition? Wrap that in a service and call it on-demand.

🛠️ Example Use Case in Isaac

Suppose you're building a safety test rig:

  • A test manager node sends a service request to /start_scenario which Isaac Sim handles by launching a pre-defined situation (e.g., forklift crossing path).
  • After scenario ends, the test manager calls /reset_world to restart the environment.
  • Each result is logged after waiting for a response from /get_scenario_outcome.

This level of controlled interaction is harder to achieve with topics alone.

📌 Isaac-Specific Tip

Many ROS 2-compatible extensions in Isaac Sim expose services under familiar names like /isaac/teleport, /spawn_object, or /get_ground_height. Explore them with:

ros2 service list
ros2 service type /isaac/teleport
ros2 service call /isaac/teleport isaac_msgs/Teleport "{x: 1.0, y: 0.0, z: 0.0}"

Available Now

Book a demo and get early access. Free trial!

Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.