gd_node package
Subpackages
- gd_node.performance_metrics package
- gd_node.protocols package
- Subpackages
- Submodules
- gd_node.protocols.base module
- gd_node.protocols.movai module
- gd_node.protocols.redissub module
- gd_node.protocols.ros1 module
- gd_node.protocols.ros2 module
- Module contents
Submodules
gd_node.callback module
gd_node.message module
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
Developers: - Manuel Silva (manuel.silva@mov.ai) - 2020 - Tiago Paulino (tiago@mov.ai) - 2020
- class gd_node.message.GD_Message(_name: str, _type='msg')
Bases:
objectClass that imports and make available all Messages, Services and Actions for the GD_Node
- Parameters:
_name – package/message_name
_type – Available types are: msg, srv, action
- Raises:
Exception – Message does not exist
- get()
Method that returns the message
- Returns:
Any
- Return type:
TYPE
- get_srv()
Method that returns the full service
- Returns:
Any
- Return type:
TYPE
- class gd_node.message.GD_Message2
Bases:
objectClass that makes available all Messages and Services from ROS1, ROS2 and Redis to the GD_Node
- Parameters:
_name – package/message_name
_type – Available types are: msg, srv, action
- Raises:
Exception – Message does not exist
- get_ros1_msg(_input: Any) Any
Returns a Ros1 msg class
- get_ros1_srv()
- get_ros2_msg(_input: Any) Any
Returns a Ros2 msg class. Accepts string with package/message and ROS1/ROS2 message class instance
- get_ros2_srv(_input: Any) Any
Returns a Ros2 srv class. Accepts string with package/service and ROS1/ROS2 service Request/Responce class instance
gd_node.metrics module
DEPRECATED: This module is no longer functional and will be removed in a future release. Any usage will raise a RuntimeError.
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
Previous usage (no longer supported):
from libraries import Metrics metrics_a = Metrics(<name>)
metrics_a.add(<value>, tags=[<string>, <string>,…]) – or – metrics_a.log(<value>, tags=[<string>, <string>,…])
- class gd_node.metrics.HealthNodeHandler(*args, **kwargs)
Bases:
object
- class gd_node.metrics.Metrics(*args, **kwargs)
Bases:
object
gd_node.node module
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
- gd_node.node.CoreInterruptHandler(signalnum)
Core interrupt handler for GD_Node. This function is called when the GD_Node receives a signal to stop (SIGINT or SIGTERM). It sets the GD_User.STOP event to signal the node to stop gracefully.
- class gd_node.node.GDNode(args, unknown, perf_metrics)
Bases:
objectGD_Node asynchronous class
- async collect_metrics() None
Periodic collection of runtime metrics
- async connect() None
Connect to aioredis slave db
- handle_exception(loop, context)
- async init_iports(inst_name: str, ports_templates: dict, ports_inst: dict, init: bool = False, transition_data=None)
Initialize input ports
This function initializes input ports based on the provided templates and instances. :param inst_name: Instance name of the node :param ports_templates: Dictionary of port templates :param ports_inst: Dictionary of port instances :param init: Boolean indicating if this is an initialization phase :param transition_data: Data for transition messages, if any
- async init_oports(inst_name: str, ports_templates: dict, ports_inst: dict, flow_name: str)
Init all the output ports
This function initializes all output ports based on the provided templates and instances.
- Parameters:
inst_name – Instance name of the node
ports_templates – Description
ports_inst – Description
flow_name – Name of the flow to which the ports belong
- async init_transports(node_name: str, inst_name: str, ports_templates: dict, transports: dict, remaps: list)
Initialize required transports This function checks the port templates for required transports and initializes them.
- Parameters:
node_name (str) – Name of the node
inst_name (str) – Instance name of the node
ports_templates (dict) – Dictionary of port templates
transports (dict) – Dictionary of transport names and their status
remaps (list) – List of remaps for transport initialization
- initial_print(inst_name: str, template_name: str, inst_params: list)
Some inital debug prints
- async main(args, unknown) None
Runs the main loop. Exiting stops GDNode
- async stop() None
Gracefully shutdown node
gd_node.notifications module
gd_node.protocol module
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
Developers: - Manuel Silva (manuel.silva@mov.ai) - 2020 - Tiago Paulino (tiago@mov.ai) - 2020
Module that implements all the tranports and protocols currently supported by the GD_Node
- class gd_node.protocol.IportHttpRoute(**kwargs)
Bases:
object
- class gd_node.protocol.IportMovaiContextServer(**kwargs)
Bases:
object
- class gd_node.protocol.IportMovaiDependency(**kwargs)
Bases:
object
- class gd_node.protocol.IportMovaiInit(**kwargs)
Bases:
object
- class gd_node.protocol.IportMovaiSM(**kwargs)
Bases:
object
- class gd_node.protocol.IportMovaiTransition(**kwargs)
Bases:
object
- class gd_node.protocol.IportRos1Action(**kwargs)
Bases:
object
- class gd_node.protocol.IportRos1Timer(**kwargs)
Bases:
object
- class gd_node.protocol.IportVarSub(**kwargs)
Bases:
object
- class gd_node.protocol.IportWebSocket(**kwargs)
Bases:
object
- class gd_node.protocol.OportMovaiContextClient(node_name, name, topic, message, _params, **_ignore)
Bases:
object
- class gd_node.protocol.OportMovaiContextServer(node_name, name, topic, message, _params, **_ignore)
Bases:
object
- class gd_node.protocol.OportMovaiDepends(name, node_name, **_ignore)
Bases:
object
- class gd_node.protocol.OportMovaiTransition(name, node_name, flow_name, **_ignore)
Bases:
object
- class gd_node.protocol.OportRos1ActionClient(name, topic, message, **_ignore)
Bases:
object
- class gd_node.protocol.OportRos1DynReconfigure(name, topic, message, **_ignore)
Bases:
object- shutdown()
- class gd_node.protocol.OportRos1Parameter(name, topic, message, _params, **_ignore)
Bases:
object
- class gd_node.protocol.OportRos1Pub(name, topic, message, _params=None, _gd_node=None, **_ignore)
Bases:
object- shutdown()
- class gd_node.protocol.OportRos1ServiceClient(name, topic, message, **_ignore)
Bases:
object- shutdown()
- class gd_node.protocol.OportRos1Tf(name, topic, message, _params, **_ignore)
Bases:
object- shutdown()
- class gd_node.protocol.OportRos2Pub(name, topic, message, _params, **_ignore)
Bases:
object
- class gd_node.protocol.OportRos2ServiceClient(name, topic, message, _params, **_ignore)
Bases:
object
- class gd_node.protocol.Params(_name: str, _value: Any)
Bases:
objectMakes GD_Node parameters accessible in all callbacks
- Parameters:
_name – Name of the parameter
_value – Value of the parameter
- class gd_node.protocol.PortsProvider
Bases:
objectClass to help create ports instances
- create(key, **kwargs)
- on_shutdown(**kwargs)
- register(key, builder)
- register_event(key, callback)
- shutdown()
- class gd_node.protocol.TransportHttp
Bases:
object
- class gd_node.protocol.TransportRedis
Bases:
object
- class gd_node.protocol.TransportSocketIO
Bases:
object
gd_node.user module
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
Developers: - Manuel Silva (manuel.silva@mov.ai) - 2020 - Tiago Paulino (tiago@mov.ai) - 2020
Module to store and give access to GD_Node Iports, Oports and Parameters during runtime
- class gd_node.user.GD_User
Bases:
objectUser class
- iport
Input ports of the node
- Type:
dict
- name
Name of the node instance
- Type:
str
- oport
Output ports of the node
- Type:
dict
- params
Parameters of the node instance
- Type:
dict
- STOP: Event | None = None
- iport = {}
- name = ''
- oport = {}
- params = {}
- classmethod send(port, msg='')
Making send function easy to write
- template = ''
Module contents
Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential
Developers: - Alexandre Pires (alexandre.pires@mov.ai) - 2020