View Source Rclex.ResourceServer (Rclex v0.9.0)

Defines functions to manage ROS resources, Node and Timer.

Summary

Functions

Returns a specification to start this module under a supervisor.

Create specified name single Node without namespace. This function calls create_node_with_namespace/5 with namespace = ''.

Create specified name multiple Nodes without namespace. This function calls create_nodes_with_namespace/6 with node_namespace = ''.

Create a specified name Rclex.Timer and a Supervisor which supervise the timer. This function calls create_timer_with_limit/7 with limit = 0(no limit).

Create a specified name Rclex.Timer and a Supervisor which supervise the timer. Arguments are used to configure Rclex.Timer.

Finish Rclex.Node named with node_identifier by stopping its Supervisor.

Call finish_node/1 for each node_identifier_list element.

ResourceServerプロセスの初期化
状態:
    supervisor_ids :: map()
    keyがnode_identifiervalueがnode情報現在はnodeプロセスのsupervisorのidを格納している

Stop Rclex.Timer named with timer_identifier by stopping its Supervisor.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create_node(context, node_name, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_node(Rclex.Nifs.rcl_context(), charlist(), integer(), (list() -> list())) ::
  {:ok, node_identifier :: charlist()}

Create specified name single Node without namespace. This function calls create_node_with_namespace/5 with namespace = ''.

Link to this function

create_node_with_namespace(context, node_name, node_namespace, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_node_with_namespace(
  Rclex.Nifs.rcl_context(),
  charlist(),
  charlist(),
  integer(),
  (list() -> list())
) :: {:ok, node_identifier :: charlist()}

Create specified name single Node with specified namespace.

Arguments

  • context: rcl context
  • node_name: node name
  • node_namespace: node namespace
  • queue_length: executor's queue length
  • change_order: function which change the order of job
Link to this function

create_nodes(context, node_name, num_node, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_nodes(
  Rclex.Nifs.rcl_context(),
  charlist(),
  integer(),
  integer(),
  (list() -> list())
) ::
  {:ok, [node_identifier :: charlist()]} | :error

Create specified name multiple Nodes without namespace. This function calls create_nodes_with_namespace/6 with node_namespace = ''.

Link to this function

create_nodes_with_namespace(context, node_name, node_namespace, num_node, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_nodes_with_namespace(
  Rclex.Nifs.rcl_context(),
  charlist(),
  charlist(),
  integer(),
  integer(),
  (list() -> list())
) :: {:ok, [node_identifier :: charlist()]}

Create specified name multiple Nodes with specified node namespace.

Link to this function

create_timer(call_back, args, time, timer_name, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_timer(
  function(),
  any(),
  integer(),
  charlist(),
  integer(),
  (list() -> list())
) ::
  {:ok, timer_identifier :: String.t()}

Create a specified name Rclex.Timer and a Supervisor which supervise the timer. This function calls create_timer_with_limit/7 with limit = 0(no limit).

Link to this function

create_timer_with_limit(call_back, args, time, timer_name, limit, queue_length \\ 1, change_order \\ & &1)

View Source
@spec create_timer_with_limit(
  function(),
  any(),
  integer(),
  charlist(),
  integer(),
  integer(),
  (list() -> list())
) :: {:ok, timer_identifier :: String.t()}

Create a specified name Rclex.Timer and a Supervisor which supervise the timer. Arguments are used to configure Rclex.Timer.

Arguments

  • callback: callback function
  • args: callback arguments
  • time: periodic time, milliseconds
  • timer_name: timer name
  • limit: limit of execution times, 0 means no limit
  • queue_length: executor's queue length
  • change_order: function which change the order of job
Link to this function

finish_node(node_identifier)

View Source
@spec finish_node(node_identifier :: charlist()) :: :ok | :error

Finish Rclex.Node named with node_identifier by stopping its Supervisor.

Link to this function

finish_nodes(node_identifier_list)

View Source
@spec finish_nodes([node_identifier :: charlist()]) :: list()

Call finish_node/1 for each node_identifier_list element.

@spec init(any()) :: {:ok, {map()}}
ResourceServerプロセスの初期化
状態:
    supervisor_ids :: map()
    keyがnode_identifiervalueがnode情報現在はnodeプロセスのsupervisorのidを格納している
@spec start_link(any()) :: GenServer.on_start()
Link to this function

stop_timer(timer_identifier)

View Source
@spec stop_timer(timer_identifier :: String.t()) :: :ok | :error

Stop Rclex.Timer named with timer_identifier by stopping its Supervisor.