ROS2Interface Plugin API reference
This plugin provides an interface with the ROS2 API
simROS2.advertise
simROS2.advertiseService
simROS2.call
simROS2.deleteParam
simROS2.getParamBool
simROS2.getParamDouble
simROS2.getParamInt
simROS2.getParamString
simROS2.getTime
Description
|
Return the current ROS time (i.e. the time returned by ros::Time::now()). |
Lua synopsis |
double time=simROS2.getTime(int flag=0)
|
Lua parameters |
flag (int, default: 0): unused: set to zero |
Lua return values |
time (double): ROS time expressed in seconds |
See also
|
|
simROS2.hasParam
simROS2.imageTransportAdvertise
simROS2.imageTransportPublish
simROS2.imageTransportShutdownPublisher
simROS2.imageTransportShutdownSubscriber
simROS2.imageTransportSubscribe
simROS2.publish
simROS2.publisherTreatUInt8ArrayAsString
simROS2.searchParam
simROS2.sendTransform
Description
|
Publish a TF transformation between frames. |
Lua synopsis |
simROS2.sendTransform(table transform)
|
Lua parameters |
transform (table of ): the transformation expressed as a geometry_msgs/TransformStamped message, i.e. {header={stamp=timeStamp, frame_id='...'}, child_frame_id='...', transform={translation={x=..., y=..., z=...}, rotation={x=..., y=..., z=..., w=...}}} |
Lua return values |
- |
See also
|
simROS2.advertise simROS2.imageTransportAdvertise simROS2.imageTransportPublish simROS2.imageTransportShutdownPublisher simROS2.imageTransportShutdownSubscriber simROS2.imageTransportSubscribe simROS2.publish simROS2.publisherTreatUInt8ArrayAsString simROS2.sendTransforms simROS2.shutdownPublisher simROS2.shutdownSubscriber simROS2.subscribe simROS2.subscriberTreatUInt8ArrayAsString simROS2.sendTransforms
|
simROS2.sendTransforms
simROS2.serviceClient
simROS2.serviceClientTreatUInt8ArrayAsString
simROS2.serviceServerTreatUInt8ArrayAsString
simROS2.setParamBool
simROS2.setParamDouble
simROS2.setParamInt
simROS2.setParamString
simROS2.shutdownPublisher
simROS2.shutdownServiceClient
simROS2.shutdownServiceServer
simROS2.shutdownSubscriber
simROS2.subscribe
Description
|
Subscribe to a topic. |
Lua synopsis |
int subscriberHandle=simROS2.subscribe(string topicName, string topicType, string topicCallback, int queueSize=1)
|
Lua parameters |
topicName (string): topic name, e.g.: '/cmd_vel'
topicType (string): topic type, e.g.: 'geometry_msgs::Twist'
topicCallback (string): name of the callback function, which will be called with a single argument of type table containing the message payload, e.g.: {linear={x=1.5, y=0.0, z=0.0}, angular={x=0.0, y=0.0, z=-2.3}}
queueSize (int, default: 1): (optional) queue size
|
Lua return values |
subscriberHandle (int): a handle to the ROS subscriber |
See also
|
simROS2.advertise simROS2.imageTransportAdvertise simROS2.imageTransportPublish simROS2.imageTransportShutdownPublisher simROS2.imageTransportShutdownSubscriber simROS2.imageTransportSubscribe simROS2.publish simROS2.publisherTreatUInt8ArrayAsString simROS2.sendTransform simROS2.sendTransforms simROS2.shutdownPublisher simROS2.shutdownSubscriber simROS2.subscriberTreatUInt8ArrayAsString
|
simROS2.subscriberTreatUInt8ArrayAsString
Script functions
Script functions are used to call some lua code from the plugin side (tipically used for event handlers).
subscriberCallback
Description
|
Callback for ROS subscriber. |
Lua synopsis |
simROS2.subscriberCallback(table message)
|
Lua parameters |
message (table of ): the topic payload (i.e. the message) |
Lua return values |
- |
See also
|
|
imageTransportCallback
Description
|
Callback for ROS ImageTransport subscriber. |
Lua synopsis |
simROS2.imageTransportCallback(string data, int width, int height)
|
Lua parameters |
data (string): the image data
width (int): image width
height (int): image height
|
Lua return values |
- |
See also
|
|
|