.. _ros_service_server: ROS Service Server/Client ========================= .. image:: images/ros_service_client_server.png Within a ROS Node GenericDomainModel, a **ROS Service Server** or **Client** is represented by a **GenericDomainModelPort** with the following **Attributes.** +-------------+---------------------------------------------------+---------------------------------------------------------------+ | Attributes | Value | Description | +=============+===================================================+===============================================================+ | Type | service | | +-------------+---------------------------------------------------+---------------------------------------------------------------+ | Attribute 0 | force_name | Use the GenericDomainModelPort's name as the ROS Service name | +-------------+---------------------------------------------------+---------------------------------------------------------------+ | Attribute 1 | arg / arg_1_hyphen / arg_2_hyphen / param / remap | Method used to map ROS Service names into ROS Node | +-------------+---------------------------------------------------+---------------------------------------------------------------+ | Attribute 2 | *[msg type]* | ROS Service Msg Type *- e.g. Trigger* | +-------------+---------------------------------------------------+---------------------------------------------------------------+ | Attribute 7 | ros | | +-------------+---------------------------------------------------+---------------------------------------------------------------+ If the CyPhy Master Interpreter is run, these Attributes will be used to populate the parent ROS Node Model's corresponding node element in the generated ROS .launch file. For each netlist of connected ports, the Interpreter will check that the the port types all match *(e.g. a ROS Topic Publisher cannot broadcast to a ROS Service Server)* and that the Service Msg types *(if specified)* all match. If a port's **Attribute 0 Value** is **force_name**, then all ports on that netlist will be assigned the forcing GenericDomainModelPort's name. If two or more ports have their **Attribute 0 Value** set to **force_name**, then one of their names will be picked at random and assigned to all ports on that netlist. Be careful using **force_name**. Otherwise, a unique ROS Service name will be generated and assigned to ports in that netlist. The ROS Service mapping method is determined by **Attribute 1**'s **Value**: **arg** or **[empty]** .. code-block:: none Unless the *[GenericDomainModelPort name]* ends with an underscore *- e.g. count_*, then the *[GenericDomainModelPort name]* is ommitted. .. code-block:: none .. note:: ROS Node args passed in will be sorted by *[GenericDomainModelPort name]* in alphanumerical order. ---- **arg_1_hypen** .. code-block:: none ---- **arg_2_hypen** .. code-block:: none ---- **param** .. code-block:: none ---- **remap** .. code-block:: none