Module: rclnodejs

A module that exposes the rclnodejs interfaces.
Source:

Members

(static) ActionClient

ActionClient class
Source:

(static) ActionServer

ActionServer class
Source:

(static) CancelResponse

Source:

(static) ClientGoalHandle

Source:

(static) Clock

Clock class
Source:

(static) ClockType

ClockType enum
Source:

(static) Context

Context class
Source:

(static) Duration

Duration class
Source:

(static) FloatingPointRange

Source:

(static) getActionClientNamesAndTypesByNode

Source:

(static) getActionNamesAndTypes

Source:

(static) getActionServerNamesAndTypesByNode

Source:

(static) GoalResponse

Source:

(static) IntegerRange

IntegerRange class
Source:

(static) lifecycle

Lifecycle namespace
Source:

(static) logging

Logging class
Source:

(static) NodeOptions

NodeOptions class
Source:

(static) Parameter

Source:

(static) ParameterDescriptor

Source:

(static) ParameterType

Source:

(static) QoS

QoS class
Source:

(static) ROSClock

ROSClock class
Source:

(static) ServerGoalHandle

Source:

(static) Time

Time class
Source:

(static) TimeSource

TimeSource class
Source:

(static) validator

validator object
Source:

(inner, constant) The :number

plus/minus tolerance for determining number equivalence.
Type:
  • number
Source:
See:

Methods

(static) createLifecycleNode(nodeName, namespaceopt, contextopt, optionsopt) → {LifecycleNode}

Create a managed Node that implements a well-defined life-cycle state model using the ros2 client library (rcl) lifecyle api.
Parameters:
Name Type Attributes Default Description
nodeName string The name used to register in ROS.
namespace string <optional>
'' The namespace used in ROS.
context Context <optional>
Context.defaultContext() The context to create the node in.
options NodeOptions <optional>
NodeOptions.defaultOptions The options to configure the new node behavior.
Source:
Throws:
If the given context is not registered.
Type
Error
Returns:
A new instance of the specified node.
Type
LifecycleNode

(static) createMessageObject(type) → {Object|undefined}

Create a plain JavaScript from the specified type identifier.
Parameters:
Name Type Description
type string | Object - the type identifier, acceptable formats could be 'std_msgs/std/String' or {package: 'std_msgs', type: 'msg', name: 'String'}
Source:
Returns:
A plain JavaScript of that type, or undefined if the object could not be created
Type
Object | undefined

(static) createNode(nodeName, namespaceopt, contextopt, optionsopt) → {Node}

Create and initialize a node.
Parameters:
Name Type Attributes Default Description
nodeName string The name used to register in ROS.
namespace string <optional>
'' The namespace used in ROS.
context Context <optional>
Context.defaultContext() The context to create the node in.
options NodeOptions <optional>
NodeOptions.defaultOptions The options to configure the new node behavior.
Source:
Throws:
If the given context is not registered.
Type
Error
Returns:
A new instance of the specified node.
Type
Node

(static) expandTopicName(topicName, nodeName, nodeNamespace) → {string}

Expand a given topic name using given node name and namespace as well.
Parameters:
Name Type Description
topicName string Topic name to be expanded.
nodeName string Name of the node that this topic is associated with.
nodeNamespace string Namespace that the topic is within.
Source:
Returns:
Expanded topic name which is fully qualified.
Type
string

(static) init(contextopt, argv) → {Promise.<undefined>}

Initialize the module.
Parameters:
Name Type Attributes Default Description
context Context <optional>
Context.defaultContext() The context to initialize.
argv Array.<string> Process command line arguments.
Source:
Throws:
If the given context has already been initialized or the command line arguments argv could not be parsed.
Type
Error
Returns:
A Promise.
Type
Promise.<undefined>

(static) isShutdown(contextopt) → {boolean}

A predicate for testing if a context has been shutdown.
Parameters:
Name Type Attributes Default Description
context Context <optional>
Context.defaultContext() The context to inspect.
Source:
Returns:
Return true if the module is shut down, otherwise return false.
Type
boolean

(static) isTopicOrServiceHidden(name) → {boolean}

Judge if the topic/service is hidden (see the ROS2 design documentation).
Parameters:
Name Type Description
name string Name of topic/service.
Source:
Returns:
- True if a given topic or service name is hidden, otherwise False.
Type
boolean

(static) regenerateAll() → {Promise.<undefined>}

Search packages which locate under path $AMENT_PREFIX_PATH, regenerate all JavaScript structs files from the IDL of messages(.msg) and services(.srv) and put these files under folder 'generated'. Any existing files under this folder will be overwritten after the execution.
Source:
Returns:
A Promise.
Type
Promise.<undefined>

(static) removeSignalHandlers() → {undefined}

Removes the default signal handler installed by rclnodejs. After calling this, rclnodejs will no longer clean itself up when a SIGINT is received, it is the application's responsibility to properly shut down all nodes and contexts. Application which wishes to implement its own signal handler logic should call this.
Source:
Returns:
Type
undefined

(static) require(name) → {object}

Get the interface package, which is used by publisher/subscription or client/service.
Parameters:
Name Type Description
name string The name of interface to be required.
Source:
Returns:
- the object of the required package/interface.
Type
object

(static) shutdown(contextopt) → {undefined}

Shuts down the given context by shutting down and destroying all nodes contained within. If no context is explicitly given, only the default context will be shut down, and not all of them. This follows the semantics of rclpy.shutdown().
Parameters:
Name Type Attributes Default Description
context Context <optional>
Context.defaultContext() The context to be shutdown.
Source:
Throws:
If there is a problem shutting down the context or while destroying or shutting down a node within it.
Type
Error
Returns:
Type
undefined

(static) spin(node, timeoutopt) → {undefined}

Start to spin the node, which triggers the event loop to start to check the incoming events.
Parameters:
Name Type Attributes Default Description
node Node The node to be spun.
timeout number <optional>
10 Timeout to wait in milliseconds. Block forever if negative. Don't wait if 0.
Source:
Throws:
If the node is already spinning.
Type
Error
Returns:
Type
undefined

(static) spinOnce(node, timeoutopt) → {undefined}

Execute one item of work or wait until a timeout expires.
Parameters:
Name Type Attributes Default Description
node Node The node to be spun once.
timeout number <optional>
10 Timeout to wait in milliseconds. Block forever if negative. Don't wait if 0.
Source:
Throws:
If the node is already spinning.
Type
Error
Returns:
Type
undefined