BlueZero Plugin API reference

BlueZero plugin for V-REP.

simB0.call

Description Call a service.
Lua synopsis string payload=simB0.call(string handle, string payload)
Lua parameters
handle (string): service client handle
payload (string): request payload
Lua return values
payload (string): response payload
See also simB0.createServiceClient simB0.createServiceServer simB0.destroyServiceClient simB0.destroyServiceServer simB0.setCompression

simB0.cleanup

Description Cleanup a node.
Lua synopsis simB0.cleanup(string handle)
Lua parameters
handle (string): node handle
Lua return values -
See also simB0.create simB0.destroy simB0.init simB0.setAnnounceTimeout simB0.spin simB0.spinOnce

simB0.create

Description Create a new node.
Lua synopsis string handle=simB0.create(string name)
Lua parameters
name (string): name of the node (will be changed if not unique during initialization)
Lua return values
handle (string): a handle to the new node
See also simB0.cleanup simB0.destroy simB0.init simB0.setAnnounceTimeout simB0.spin simB0.spinOnce

simB0.createPublisher

Description Create a new publisher.
Lua synopsis string handle=simB0.createPublisher(string nodeHandle, string topic)
Lua parameters
nodeHandle (string): node handle
topic (string): topic name
Lua return values
handle (string): a handle to the new publisher
See also simB0.createSubscriber simB0.destroyPublisher simB0.destroySubscriber simB0.publish simB0.setCompression

simB0.createServiceClient

Description Create a new service client.
Lua synopsis string handle=simB0.createServiceClient(string nodeHandle, string service)
Lua parameters
nodeHandle (string): node handle
service (string): service name
Lua return values
handle (string): a handle to the new service client
See also simB0.call simB0.createServiceServer simB0.destroyServiceClient simB0.destroyServiceServer simB0.setCompression

simB0.createServiceServer

Description Create a new service server.
Lua synopsis string handle=simB0.createServiceServer(string nodeHandle, string service, string callback=)
Lua parameters
nodeHandle (string): node handle
service (string): service name
callback (string, default: ): lua calback to call when a request is received
Lua return values
handle (string): a handle to the new service server
See also simB0.call simB0.createServiceClient simB0.destroyServiceClient simB0.destroyServiceServer simB0.setCompression

simB0.createSubscriber

Description Create a new subscriber.
Lua synopsis string handle=simB0.createSubscriber(string nodeHandle, string topic, string callback=)
Lua parameters
nodeHandle (string): node handle
topic (string): topic name
callback (string, default: ): lua calback to call when a message is received
Lua return values
handle (string): a handle to the new subscriber
See also simB0.createPublisher simB0.destroyPublisher simB0.destroySubscriber simB0.publish simB0.setCompression

simB0.destroy

Description Destroy a node.
Lua synopsis simB0.destroy(string handle)
Lua parameters
handle (string): node handle
Lua return values -
See also simB0.cleanup simB0.create simB0.init simB0.setAnnounceTimeout simB0.spin simB0.spinOnce

simB0.destroyPublisher

Description Destroy a publisher.
Lua synopsis simB0.destroyPublisher(string handle)
Lua parameters
handle (string): publisher handle
Lua return values -
See also simB0.createPublisher simB0.createSubscriber simB0.destroySubscriber simB0.publish simB0.setCompression

simB0.destroyServiceClient

Description Destroy a service client.
Lua synopsis simB0.destroyServiceClient(string handle)
Lua parameters
handle (string): service client handle
Lua return values -
See also simB0.call simB0.createServiceClient simB0.createServiceServer simB0.destroyServiceServer simB0.setCompression

simB0.destroyServiceServer

Description Destroy a service server.
Lua synopsis simB0.destroyServiceServer(string handle)
Lua parameters
handle (string): service server handle
Lua return values -
See also simB0.call simB0.createServiceClient simB0.createServiceServer simB0.destroyServiceClient simB0.setCompression

simB0.destroySubscriber

Description Destroy a subscriber.
Lua synopsis simB0.destroySubscriber(string handle)
Lua parameters
handle (string): subscriber handle
Lua return values -
See also simB0.createPublisher simB0.createSubscriber simB0.destroyPublisher simB0.publish simB0.setCompression

simB0.init

Description Initialize a node.
Lua synopsis string name=simB0.init(string handle)
Lua parameters
handle (string): node handle
Lua return values
name (string): final name of the node as assigned from resolver node
See also simB0.cleanup simB0.create simB0.destroy simB0.setAnnounceTimeout simB0.spin simB0.spinOnce

simB0.publish

Description Publish some data.
Lua synopsis simB0.publish(string handle, string payload)
Lua parameters
handle (string): publisher handle
payload (string): message payload
Lua return values -
See also simB0.createPublisher simB0.createSubscriber simB0.destroyPublisher simB0.destroySubscriber simB0.setCompression

simB0.setAnnounceTimeout

Description Set the announceNode timeout.
Lua synopsis simB0.setAnnounceTimeout(string handle, int timeout)
Lua parameters
handle (string): node handle
timeout (int): timeout in milliseconds, or -1 for no timeout
Lua return values -
See also simB0.cleanup simB0.create simB0.destroy simB0.init simB0.spin simB0.spinOnce

simB0.setCompression

Description Set compression for the specified publisher/service client/service server.
Lua synopsis simB0.setCompression(string handle, string compression_algorithm, int compression_level=-1)
Lua parameters
handle (string): publisher/service client/service server handle
compression_algorithm (string): compression algorithm to use. an empty string will dsable compression.
compression_level (int, default: -1): compression level (-1 will use default level)
Lua return values -
See also simB0.createPublisher simB0.createSubscriber simB0.destroyPublisher simB0.destroySubscriber simB0.publish simB0.call simB0.createServiceClient simB0.createServiceServer simB0.destroyServiceClient simB0.destroyServiceServer

simB0.spin

Description Spin a node.
Lua synopsis simB0.spin(string handle)
Lua parameters
handle (string): node handle
Lua return values -
See also simB0.cleanup simB0.create simB0.destroy simB0.init simB0.setAnnounceTimeout simB0.spinOnce

simB0.spinOnce

Description Spin a node.
Lua synopsis simB0.spinOnce(string handle)
Lua parameters
handle (string): node handle
Lua return values -
See also simB0.cleanup simB0.create simB0.destroy simB0.init simB0.setAnnounceTimeout simB0.spin



Script functions

Script functions are used to call some lua code from the plugin side (tipically used for event handlers).

topicCallback

Description Callback for a subscriber.
Lua synopsis simB0.topicCallback(string payload)
Lua parameters
payload (string): raw payload
Lua return values -
See also

serviceCallback

Description Callback for a service server.
Lua synopsis string payload=simB0.serviceCallback(string payload)
Lua parameters
payload (string): raw request payload
Lua return values
payload (string): raw response payload
See also