> ## Documentation Index
> Fetch the complete documentation index at: https://docs.innate.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Services

export const RosServicesInterface = () => {
  const serviceSections = [{
    id: "arm-control",
    title: "Arm Control",
    rows: [{
      service: "/mars/arm/goto_js",
      type: "mars_msgs/GotoJS",
      desc: "Move arm joints to target positions over a specified duration (time in seconds)."
    }, {
      service: "/mars/head/set_ai_position",
      type: "std_srvs/Trigger",
      desc: "Set the head to the default AI viewing position."
    }]
  }, {
    id: "navigation-maps",
    title: "Navigation and Maps",
    rows: [{
      service: "/localize",
      type: "std_srvs/Trigger",
      desc: "Trigger grid localization to estimate robot pose on the current map."
    }, {
      service: "/nav/change_navigation_map",
      type: "brain_messages/ChangeMap",
      desc: "Switch the active saved map."
    }, {
      service: "/nav/save_map",
      type: "brain_messages/SaveMap",
      desc: "Save the current mapping session."
    }, {
      service: "/nav/delete_map",
      type: "brain_messages/DeleteMap",
      desc: "Delete a saved map."
    }, {
      service: "/nav/change_mode",
      type: "brain_messages/ChangeNavigationMode",
      desc: "Switch between mapfree, mapping, and navigation modes."
    }]
  }, {
    id: "system",
    title: "System",
    rows: [{
      service: "/light_command",
      type: "mars_msgs/LightCommand",
      desc: "Control LED mode, interval, and RGB color."
    }, {
      service: "/shutdown",
      type: "mars_msgs/Shutdown",
      desc: "Trigger robot shutdown sequence."
    }, {
      service: "/set_robot_name",
      type: "mars_msgs/SetRobotName",
      desc: "Set display name used by app and hostname conversion."
    }, {
      service: "/trigger_update",
      type: "mars_msgs/TriggerUpdate",
      desc: "Trigger update flow on the robot."
    }]
  }, {
    id: "brain-agent",
    title: "Brain and Agent Runtime",
    rows: [{
      service: "/brain/get_available_directives",
      type: "brain_messages/GetAvailableDirectives",
      desc: "List available agents. (Agents were formerly called directives; the ROS name is kept for compatibility.)"
    }, {
      service: "/brain/reload_skills_agents",
      type: "brain_messages/ReloadSkillsAgents",
      desc: "Reload agents and skills from the workspace directories."
    }, {
      service: "/brain/reset_brain",
      type: "brain_messages/ResetBrain",
      desc: "Reset brain runtime state."
    }, {
      service: "/brain/get_chat_history",
      type: "brain_messages/GetChatHistory",
      desc: "Retrieve the Innate agent's conversation history."
    }]
  }, {
    id: "data-recording",
    title: "Data Recording",
    rows: [{
      service: "/brain/recorder/activate_physical_primitive",
      type: "brain_messages/ActivateManipulationTask",
      desc: "Start recording a new manipulation task."
    }, {
      service: "/brain/recorder/new_episode",
      type: "std_srvs/Trigger",
      desc: "Start a new episode inside current task."
    }, {
      service: "/brain/recorder/save_episode",
      type: "std_srvs/Trigger",
      desc: "Save current episode."
    }, {
      service: "/brain/recorder/cancel_episode",
      type: "std_srvs/Trigger",
      desc: "Discard current episode."
    }, {
      service: "/brain/recorder/end_task",
      type: "std_srvs/Trigger",
      desc: "Finalize current task recording."
    }, {
      service: "/brain/recorder/get_task_metadata",
      type: "brain_messages/GetTaskMetadata",
      desc: "Read metadata for a recording task."
    }]
  }];
  return <AccordionGroup>
      {serviceSections.map((section, idx) => <Accordion key={section.id} title={section.title} defaultOpen={idx < 2}>
          <div className="ros-topic-table-wrap">
            <table className="ros-topic-table">
              <thead>
                <tr>
                  <th>Service Name</th>
                  <th>Type</th>
                  <th>Description</th>
                </tr>
              </thead>
              <tbody>
                {section.rows.map(row => <tr key={row.service}>
                    <td>
                      <span className="ros-topic-code ros-topic-path">{row.service}</span>
                    </td>
                    <td>
                      <span className="ros-topic-code ros-topic-msg">{row.type}</span>
                    </td>
                    <td>{row.desc}</td>
                  </tr>)}
              </tbody>
            </table>
          </div>
        </Accordion>)}
    </AccordionGroup>;
};

Use ROS2 services for request/response operations.

## Service Interface

<RosServicesInterface />

## When to use a service

Use a service when you need a single request/response interaction (for example "do this now and return success/failure"). Use [Topics](/software/ros2/topics) for continuous streaming and [Actions](/software/ros2/actions) for long-running operations with progress/cancel.

## Quick commands

```bash theme={null}
ros2 service list
ros2 service list -t
ros2 service type /mars/arm/goto_js
ros2 interface show mars_msgs/srv/GotoJS
ros2 service call /mars/head/set_ai_position std_srvs/srv/Trigger {}
```

## Common call examples

### Set LED color

```bash theme={null}
ros2 service call /light_command mars_msgs/srv/LightCommand \
  "{mode: 1, interval: 0, r: 64, g: 31, b: 251}"
```

### Move arm in joint space

```bash theme={null}
# NOTE: `time` is the motion duration in SECONDS (float), not milliseconds.
# 2.0 means 2 seconds — passing 2000 would command a 2000-second move.
ros2 service call /mars/arm/goto_js mars_msgs/srv/GotoJS \
  "{data: {data: [0.0, -0.8, 1.2, -0.6, 0.0, 0.0]}, time: 2.0}"
```

### Switch navigation mode

```bash theme={null}
ros2 service call /nav/change_mode brain_messages/srv/ChangeNavigationMode \
  "{mode: navigation}"
```

<CardGroup cols={2}>
  <Card title="Topics" href="/software/ros2/topics">
    Streaming state and command channels.
  </Card>

  <Card title="Actions" href="/software/ros2/actions">
    Long-running tasks with feedback and cancellation.
  </Card>
</CardGroup>
