Members
member
(static) ActionClient
ActionClient class
member
(static) ActionServer
ActionServer class
member
(static) ActionUuid
ActionUuid class
member
(static) CancelResponse
ServerGoalHandle enum
member
(static) ClientGoalHandle
ClientGoalHandle class
member
(static) Clock
Clock class
member
(static) ClockType
ClockType enum
member
(static) Context
Context class
member
(static) DistroUtils
member
(static) Duration
Duration class
member
(static) FloatingPointRange
FloatingPointRange class
member
(static) GoalResponse
GoalResponse enum
member
(static) IntegerRange
IntegerRange class
member
(static) Node
Node class
member
(static) NodeOptions
NodeOptions class
member
(static) Parameter
member
(static) ParameterDescriptor
member
(static) ParameterType
member
(static) QoS
QoS class
member
(static) RMWUtils
RMWUtils
member
(static) ROSClock
ROSClock class
member
(static) ServerGoalHandle
ServerGoalHandle class
member
(static) ServiceIntrospectionStates
member
(static) Time
Time class
member
(static) TimeSource
TimeSource class
member
(static) getActionClientNamesAndTypesByNode
getActionClientNamesAndTypesByNode function
member
(static) getActionNamesAndTypes
getActionNamesAndTypes function
member
(static) getActionServerNamesAndTypesByNode
getActionServerNamesAndTypesByNode function
member
(static) lifecycle
Lifecycle namespace
member
(static) logging
Logging class
member
(static) validator
validator object
member
(inner, constant) The :number
plus/minus tolerance for determining number equivalence.
Type:
- number
- Source:
- See:
Methods
function
(static) createLifecycleNode(nodeName, namespaceopt, contextopt, optionsopt, enableCommunicationsInterfaceopt) → {LifecycleNode}
Create a LifecycleNode, 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. |
enableCommunicationsInterface |
boolean |
<optional> |
true | enable lifecycle service interfaces, e.g., GetState. |
Throws:
If the given context is not registered.
Type
Error
Returns:
A new instance of the specified node.
Type
LifecycleNode
function
(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'} |
Returns:
A plain JavaScript of that type, or undefined if the object could not be created
Type
Object
|
undefined
function
(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. |
Throws:
If the given context is not registered.
Type
Error
Returns:
A new instance of the specified node.
Type
Node
function
(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. |
Returns:
Expanded topic name which is fully qualified.
Type
string
function
(static) init(contextopt, argv) → {Promise.<undefined>}
Initialize an RCL environment, i.e., a Context, and regenerate the javascript
message files if the output format of the message-generator tool has changed.
The context serves as a container for nodes, publishers, subscribers, etc. and
must be initialized before use.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context |
Context |
<optional> |
Context.defaultContext() | The context to initialize. |
argv |
Array.<string> | Process command line arguments. |
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>
function
(static) isShutdown(contextopt) → {boolean}
Determine if an RCL environment identified by a context argument
has been shutdown.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context |
Context |
<optional> |
Context.defaultContext() | The context to inspect. |
Returns:
Return true if the module is shut down, otherwise return false.
Type
boolean
function
(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. |
Returns:
- True if a given topic or service name is hidden, otherwise False.
Type
boolean
function
(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.
Returns:
A Promise.
Type
Promise.<undefined>
function
(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.
Returns:
Type
undefined
function
(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. |
Returns:
- the object of the required package/interface.
Type
object
function
(static) shutdown(contextopt) → {undefined}
Shutdown an RCL environment identified by a context. The shutdown process will
destroy all nodes and related resources in the context. If no context is
explicitly given, the default context will be shut down.
This follows the semantics of
rclpy.shutdown().
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context |
Context |
<optional> |
Context.defaultContext() | The context to be shutdown. |
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
function
(static) shutdownAll() → {undefined}
Shutdown all RCL environments via their contexts.
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
function
(static) spin(node, timeoutopt) → {undefined}
Start detection and processing of units of work.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
node |
Node | The node to be spun up. | ||
timeout |
number |
<optional> |
10 | Timeout to wait in milliseconds. Block forever if negative. Don't wait if 0. |
Throws:
If the node is already spinning.
Type
Error
Returns:
Type
undefined
function
(static) spinOnce(node, timeoutopt) → {undefined}
Spin the node and trigger the event loop to check for one incoming event. Thereafter the node
will not received additional events until running additional calls to spin() or spinOnce().
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. |
Throws:
If the node is already spinning.
Type
Error
Returns:
Type
undefined