B0-based remote API, C++

BlueZero is deprecated. We highly recommend using the ZeroMQ remote API instead.

simxAddDrawingObject_cubes

Description Displays cubes in the scene
synopsis std::vector<msgpack::object>* simxAddDrawingObject_cubes(float size, int[3] color, const float* coords_data,size_t coords_floatCnt, const char* topic)
Parameters
size: The size of the cubes
color: The RGB color of the cubes (0-255). Specify negative values for emissive color
coords: The coordinates for the cubes to display (3 per cube)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created drawing object
See also
Other languages

simxAddDrawingObject_points

Description Displays points in the scene
synopsis std::vector<msgpack::object>* simxAddDrawingObject_points(int size, int[3] color, const float* coords_data,size_t coords_floatCnt, const char* topic)
Parameters
size: The pixel size of the points
color: The RGB color of the points (0-255). Specify negative values for emissive color
coords: The coordinates for the points to display (3 per point)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created drawing object
See also
Other languages

simxAddDrawingObject_segments

Description Displays line segments in the scene
synopsis std::vector<msgpack::object>* simxAddDrawingObject_segments(int lineSize, int[3] color, const float* segments_data,size_t segments_floatCnt, const char* topic)
Parameters
lineSize: The size of the segments, in pixels
color: The RGB color of the cubes (0-255). Specify negative values for emissive color
segments: The coordinates for the segments to display (6 per segment)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created drawing object
See also
Other languages

simxAddDrawingObject_spheres

Description Displays spheres in the scene
synopsis std::vector<msgpack::object>* simxAddDrawingObject_spheres(float size, int[3] color, const float* coords_data,size_t coords_floatCnt, const char* topic)
Parameters
size: The size of the spheres
color: The RGB color of the spheres (0-255). Specify negative values for emissive color
coords: The coordinates for the spheres to display (3 per sphere)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created drawing object
See also
Other languages

simxAddDrawingObject_triangles

Description Displays triangles in the scene
synopsis std::vector<msgpack::object>* simxAddDrawingObject_triangles(int[3] color, const float* triangles_data,size_t triangles_floatCnt, const char* topic)
Parameters
color: The RGB color of the triangles (0-255). Specify negative values for emissive color
triangles: The coordinates for the triangles to display (9 per triangle)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created drawing object
See also
Other languages

simxAddStatusbarMessage

Description Adds a message to the status bar
synopsis std::vector<msgpack::object>* simxAddStatusbarMessage(const char* msg, const char* topic)
Parameters
msg: The message to display
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
sim.addLog (regular API)
Other languages

simxAuxiliaryConsoleClose

Description Closes an auxiliary console window
synopsis std::vector<msgpack::object>* simxAuxiliaryConsoleClose(int consoleHandle, const char* topic)
Parameters
consoleHandle: The handle of the console window
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the console doesn't exist (anymore), 1 if the console window was closed
See also
Other languages

simxAuxiliaryConsoleOpen

Description Opens an auxiliary console window for text display
synopsis std::vector<msgpack::object>* simxAuxiliaryConsoleOpen(const char* title, int maxLines, int mode, const int position[2], const int size[2], int[3] textColor, int[3] backgroundColor, const char* topic)
Parameters
title: The title of the console window
maxLines: The number of text lines that can be displayed and buffered
mode: bit-coded value. Bit0 set indicates that the console window will automatically close at simulation end, bit1 set indicates that lines will be wrapped, bit2 set indicates that the user can close the console window, bit3 set indicates that the console will automatically be hidden during simulation pause, bit4 set indicates that the console will not automatically hide when the user switches to another scene
position: The initial position of the console window (x and y value)
size: The initial size of the console window (x and y value)
textColor: The color of the text (rgb values, 0-255)
backgroundColor: The background color of the window (rgb values, 0-255)
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created console window
See also
Other languages

simxAuxiliaryConsolePrint

Description Prints to an auxiliary console window
synopsis std::vector<msgpack::object>* simxAuxiliaryConsolePrint(int consoleHandle, const char* text, const char* topic)
Parameters
consoleHandle: The handle of the console window
text: The text to append, or the empty string to clear the console window
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the console doesn't exist (anymore), 1 if the operation was successful
See also
Other languages

simxAuxiliaryConsoleShow

Description Shows or hides an auxiliary console window
synopsis std::vector<msgpack::object>* simxAuxiliaryConsoleShow(int consoleHandle, bool showState, const char* topic)
Parameters
consoleHandle: The handle of the console window
showState: The show state of the console window
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the console doesn't exist (anymore), 1 if the console window's show state was changed
See also
Other languages

simxCallScriptFunction

Description Calls a script function inside of CoppeliaSim (i.e. server side)
synopsis std::vector<msgpack::object>* simxCallScriptFunction(const char* funcAtScriptName, int/(const char*) scriptType, const char* funcArgs_data,size_t funcArgs_charCnt, const char* topic)
Parameters
funcAtScriptName: A string representing the function name. If scriptType is sim.scripttype_childscript or sim.scripttype_customizationscript, then append a '@' followed by the path to the scene object the script is attached to, e.g. func@/path/to/object. If scriptType is sim.scripttype_addonscript, then append a '@' followed by the name of the add-on, e.g. func@Isometric scaling.
scriptType: The type of the script (specified as number or string). E.g. "sim.scripttype_mainscript" is a valid string argument that will be evaluated on the server side. See also simxEvaluateToInt
funcArgs: The function arguments, packed in a messagePack message
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (?): The first return value of the called function
item3 (?): The second return value of the called function
item4 (?): etc.
See also
sim.callScriptFunction (regular API)
Other languages

simxCheckCollision

Description Checks whether two collidable entities are colliding
synopsis std::vector<msgpack::object>* simxCheckCollision(int entity1, int/(const char*) entity2, const char* topic)
Parameters
entity1: The handle of the first entity
entity2: The handle of the second entity. Can also be the "sim.handle_all" string, to check entity1 against all other collidable objects. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (bool): The collision state of the object
See also
sim.checkCollision (regular API)
Other languages

simxCheckDistance

Description Computes the minimum distance between two measurable entities
synopsis std::vector<msgpack::object>* simxCheckDistance(int entity1, int/(const char*) entity2, float threshold, const char* topic)
Parameters
entity1: The handle of the first entity
entity2: The handle of the second entity. Can also be the "sim.handle_all" string, to check entity1 against all other measurable objects. See also simxEvaluateToInt
threshold: If distance is bigger than the threshold, the distance is not calculated. If threshold is 0 or negative, then no threshold is used
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 is distance is larger than the threshold, 1 otherwise
item3 (float): The minimum distance
item4 (float[3]): The first point of the minimum distance segment
item5 (float[3]): The second point of the minimum distance segment
See also
sim.checkDistance (regular API)
Other languages

simxCheckProximitySensor

Description Computes the detection state of a proximity sensor, for a specific detectable entity
synopsis std::vector<msgpack::object>* simxCheckProximitySensor(int handle, int/(const char*) entity, const char* topic)
Parameters
handle: The handle of the proximity sensor
entity: The handle of the entity to detect. Can also be the "sim.handle_all" string, to check all detectable entities. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): detection state (0 or 1)
item3 (float): The distance to the detected point
item4 (float[3]): The detected point relative to the sensor frame
See also
Other languages

simxCheckVisionSensor

Description Computes the detection state of a vision sensor, for a specific entity
synopsis std::vector<msgpack::object>* simxCheckVisionSensor(int handle, int/(const char*) entity, const char* topic)
Parameters
handle: The handle of the vision sensor
entity: The handle of the entity to detect. Can also be the "sim.handle_all" string, to check all objects. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): detection state (0 or 1)
item3 (float): The distance to the detected point
item4 (float[3]): The detected point relative to the sensor frame
See also
Other languages

simxClearFloatSignal

Description Clears a float signal (removes it)
synopsis std::vector<msgpack::object>* simxClearFloatSignal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxClearInt32Signal

Description Clears an int signal (removes it)
synopsis std::vector<msgpack::object>* simxClearInt32Signal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxClearStringSignal

Description Clears a string signal (removes it)
synopsis std::vector<msgpack::object>* simxClearStringSignal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxCloseScene

Description Closes current scene, and switches to another open scene
synopsis std::vector<msgpack::object>* simxCloseScene(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
sim.closeScene (regular API)
Other languages

simxCopyPasteObjects

Description Duplicates objects
synopsis std::vector<msgpack::object>* simxCopyPasteObjects(const int* objectHandles_data,size_t objectHandles_intCnt, int options, const char* topic)
Parameters
objectHandles: The handles of the objects to copy and paste
options: Bit-coded. If bit0 is set (i.e. 1), then whole models will be copied
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[]): handles of the duplicates
See also
Other languages

simxCreateDummy

Description Creates a dummy object in the scene
synopsis std::vector<msgpack::object>* simxCreateDummy(float size, int[3] color, const char* topic)
Parameters
size: The size of the dummy
color: The RGB color of the dummy (0-255). Specify negative values for emissive color
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the created dummy
See also
Other languages

simxCreatePublisher

Description Creates a custom publisher topic, and returns it
synopsis const char* simxCreatePublisher(bool dropMessages = false)
Parameters
dropMessages: Whether some messages will be dropped if a queue is forming. In that case, the freshest messages will be retained
return
The topic of the created publisher
See also
Other languages

simxCreateSubscriber

Description Creates a custom subscriber topic, and returns it
synopsis const char* simxCreateSubscriber(CB_FUNC callBackFunc, int publishInterval = 1, bool dropMessages = false)
Parameters
callBackFunc: The callback function for the subscriber
publishInterval: The rate (in terms of simulation loops) at which the server (i.e. CoppeliaSim) should publish the message
dropMessages: Whether some messages will be dropped if a queue is forming. In that case, the freshest message will be retained
return
The default subscriber topic
See also
Other languages

simxDefaultPublisher

Description Returns the topic for the default publisher
synopsis const char* simxDefaultPublisher()
Parameters
return
The default publisher topic
See also
Other languages

simxDefaultSubscriber

Description Returns the topic for the default subscriber
synopsis const char* simxDefaultSubscriber(CB_FUNC callBackFunc, int publishInterval = 1)
Parameters
callBackFunc: The callback function for the subscriber
publishInterval: The rate (in terms of simulation loops) at which the server (i.e. CoppeliaSim) should publish the message
return
The default subscriber topic
See also
Other languages

simxDisplayDialog

Description Displays a generic dialog box
synopsis std::vector<msgpack::object>* simxDisplayDialog(const char* titleText, const char* mainText, int/(const char*) dialogType, const char* inputText, const char* topic)
Parameters
titleText: The title bar text
mainText: The information text
dialogType: The generic dialog style. Can also be a string value, e.g. "sim.dlgstyle_message". See also simxEvaluateToInt
inputText: The initial text in the edit box if the dialog is an input dialog
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the dialog
See also
Other languages

simxEndDialog

Description Closes and releases resource from a previous call to simxDisplayDialog. Even if the dialog is not visible anymore, you should release resources by using this function
synopsis std::vector<msgpack::object>* simxEndDialog(int handle, const char* topic)
Parameters
handle: The handle of the generic dialog
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxEvaluateToInt

Description Evaluates a Lua expression to an integer, on the server side, e.g. sim.object_proximitysensor_type would evaluate to 5, 25+42 would evaluate to 67
synopsis std::vector<msgpack::object>* simxEvaluateToInt(const char* str, const char* topic)
Parameters
str: The Lua expression to evaluate
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): the integer value of the evaluated Lua expression
See also
Other languages

simxEvaluateToStr

Description Evaluates a Lua expression to a string, on the server side, e.g. string.gsub("Hello World", "World", "Paul") would evaluate to Hello Paul
synopsis std::vector<msgpack::object>* simxEvaluateToStr(const char* str, const char* topic)
Parameters
str: The Lua expression to evaluate
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): the string value of the evaluated Lua expression
See also
Other languages

simxExecuteScriptString

Description Executes a Lua string (i.e. runs the code)
synopsis std::vector<msgpack::object>* simxExecuteScriptString(const char* code, const char* topic)
Parameters
code: The string to execute
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (?): The first return value of the executed string
item3 (?): The second return value of the executed string
item4 (?): etc.
See also
Other languages

simxGetArrayParam

Description Retrieves a array parameter
synopsis std::vector<msgpack::object>* simxGetArrayParam(int/(const char*) paramId, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.arrayparam_gravity". See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[3]): The value of the parameter
See also
Other languages

simxGetBoolParam

Description Retrieves a bool parameter
synopsis std::vector<msgpack::object>* simxGetBoolParam(int/(const char*) paramId, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.boolparam_dynamics_handling_enabled". See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (bool): The value of the parameter
See also
Other languages

simxGetCollectionHandle

Description This is a convenience function. Since CoppeliaSim V4.2.0, collections should be dynamically created and do not have a name anymore. This function will first try to retrieve a static collection with the specified name (for backward compatibility's sake). If such a collection does not exist, it will try to return the integer signal with the specified name.
synopsis std::vector<msgpack::object>* simxGetCollectionHandle(const char* collectionName, const char* topic)
Parameters
collectionName: Name of the collection. If the name is appended by a "@silentError" suffix, then no error will be output if the collection does not exist
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the collection
Other languages

simxGetCollisionHandle

Description Deprecated. See simxCheckCollision instead.
synopsis std::vector<msgpack::object>* simxGetCollisionHandle(const char* nameOfObject, const char* topic)
Parameters
nameOfObject: The name of the collision object. If the name is appended by a "@silentError" suffix, then no error will be output if the collision object does not exist
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the collision object
See also
Other languages

simxGetDialogInput

Description Queries the input of a generic dialog box
synopsis std::vector<msgpack::object>* simxGetDialogInput(int handle, const char* topic)
Parameters
handle: The handle of the generic dialog
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): The input text
See also
Other languages

simxGetDialogResult

Description Queries the result of a generic dialog box
synopsis std::vector<msgpack::object>* simxGetDialogResult(int handle, const char* topic)
Parameters
handle: The handle of the generic dialog
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): The result of the dialog, as a string
See also
Other languages

simxGetDistanceHandle

Description Deprecated. See simxCheckDistance instead.
synopsis std::vector<msgpack::object>* simxGetDistanceHandle(const char* nameOfObject, const char* topic)
Parameters
nameOfObject: The name of the distance calculation object. If the name is appended by a "@silentError" suffix, then no error will be output if the distance object does not exist
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the distance calculation object
See also
Other languages

simxGetFloatParam

Description Retrieves a float parameter
synopsis std::vector<msgpack::object>* simxGetFloatParam(int/(const char*) paramId, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.floatparam_simulation_time_step". See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The value of the parameter
See also
Other languages

simxGetFloatSignal

Description Retrieves a float signal
synopsis std::vector<msgpack::object>* simxGetFloatSignal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The value of the signal, or nil if the signal does not exist
See also
Other languages

simxGetInt32Param

Description Retrieves an integer parameter
synopsis std::vector<msgpack::object>* simxGetInt32Param(int/(const char*) paramId, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.intparam_program_version". See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The value of the parameter
See also
Other languages

simxGetInt32Signal

Description Retrieves an int signal
synopsis std::vector<msgpack::object>* simxGetInt32Signal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The value of the signal, or nil if the signal does not exist
See also
Other languages

simxGetJointForce

Description Retrieves the force or torque applied to a joint along/about its active axis
synopsis std::vector<msgpack::object>* simxGetJointForce(int jointHandle, const char* topic)
Parameters
jointHandle: The handle of the joint
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The force or the torque applied to the joint along/about its z-axis, or nil if no value is available yet
See also
Other languages

simxGetJointMaxForce

Description Retrieves the maximum force or torque that a joint can exert
synopsis std::vector<msgpack::object>* simxGetJointMaxForce(int jointHandle, const char* topic)
Parameters
jointHandle: The handle of the joint
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The maximum force or torque that the joint can exert
See also
Other languages

simxGetJointPosition

Description Retrieves the intrinsic position of a joint
synopsis std::vector<msgpack::object>* simxGetJointPosition(int jointHandle, const char* topic)
Parameters
jointHandle: The handle of the joint
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The position of the joint, in radians or meters
See also
Other languages

simxGetJointTargetPosition

Description Retrieves the target position of a joint
synopsis std::vector<msgpack::object>* simxGetJointTargetPosition(int jointHandle, const char* topic)
Parameters
jointHandle: The handle of the joint
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The target position of the joint, in radians or meters
See also
Other languages

simxGetJointTargetVelocity

Description Retrieves the target velocity of a joint
synopsis std::vector<msgpack::object>* simxGetJointTargetVelocity(int jointHandle, const char* topic)
Parameters
jointHandle: The handle of the joint
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The target velocity of the joint, in radians/s or meters/s
See also
Other languages

simxGetObjectAlias

Description Retrieves the path/alias of an object
synopsis std::vector<msgpack::object>* simxGetObjectAlias(int objectHandle, int options, const char* topic)
Parameters
objectHandle: Handle of the object
options: Value indicating how the return value is formatted. Check the regular API equivalent for details
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): The path/alias of the object
See also
sim.getObjectAlias (regular API)
Other languages

simxGetObjectChild

Description Retrieves the handle of an object's child object
synopsis std::vector<msgpack::object>* simxGetObjectChild(int objectHandle, int index, const char* topic)
Parameters
objectHandle: The handle of the object
index: The zero-based index of the child's position. To retrieve all children of an object, call the function by increasing the index until the return value is -1
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the child, or -1 if there is no child at the given index position
See also
Other languages

simxGetObjectFloatParam

Description Retrieves a floating point parameter of an object
synopsis std::vector<msgpack::object>* simxGetObjectFloatParam(int objectHandle, int/(const char*) parameterID, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to retrieve, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The retrieved parameter
See also
Other languages

simxGetObjectHandle

Description Retrieves the handle of an object
synopsis std::vector<msgpack::object>* simxGetObjectHandle(const char* objectPath, const char* topic)
Parameters
objectPath: Path and alias of object.
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the object
See also
Other languages

simxGetObjectInt32Param

Description Retrieves an integer parameter of an object
synopsis std::vector<msgpack::object>* simxGetObjectInt32Param(int objectHandle, int/(const char*) parameterID, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to retrieve, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The retrieved parameter
See also
Other languages

simxGetObjectMatrix

Description Retrieves the transformation matrix of an object
synopsis std::vector<msgpack::object>* simxGetObjectMatrix(int objectHandle, int/(const char*) relObjHandle, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame we want the matrix. Specify -1 to retrieve the absolute matrix, "sim.handle_parent" to retrieve the matrix relative to the object's parent, or an object handle relative to whose reference frame you want the matrix. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[12]): The (Xx,Yx,Zx,Px,Xy,Yy,Zy,Py,Xz,Yz,Zz,Pz) transformation matrix of the object
See also
Other languages

simxGetObjectOrientation

Description Retrieves the Euler angles orientation of an object
synopsis std::vector<msgpack::object>* simxGetObjectOrientation(int objectHandle, int/(const char*) relObjHandle, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame we want the orientation. Specify -1 to retrieve the absolute orientation, "sim.handle_parent" to retrieve the orientation relative to the object's parent, or an object handle relative to whose reference frame you want the orientation. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[3]): The (alpha,beta,gamma) Euler angles of the object
See also
Other languages

simxGetObjectParent

Description Retrieves the handle of an object's parent object
synopsis std::vector<msgpack::object>* simxGetObjectParent(int objectHandle, const char* topic)
Parameters
objectHandle: The handle of the object
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the parent, or -1 if the object has no parent
See also
Other languages

simxGetObjectPose

Description Retrieves the position and quaternion of an object
synopsis std::vector<msgpack::object>* simxGetObjectPose(int objectHandle, int/(const char*) relObjHandle, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame we want the pose. Specify -1 to retrieve the absolute pose, "sim.handle_parent" to retrieve the pose relative to the object's parent, or an object handle relative to whose reference frame you want the pose. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[7]): The (X,Y,Z,Qx,Qy,Qz,Qw) pose of the object
See also
Other languages

simxGetObjectPosition

Description Retrieves the position of an object
synopsis std::vector<msgpack::object>* simxGetObjectPosition(int objectHandle, int/(const char*) relObjHandle, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame we want the position. Specify -1 to retrieve the absolute position, "sim.handle_parent" to retrieve the position relative to the object's parent, or an object handle relative to whose reference frame you want the position. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[3]): The (X,Y,Z) position of the object
See also
Other languages

simxGetObjectQuaternion

Description Retrieves the quaternion orientation of an object
synopsis std::vector<msgpack::object>* simxGetObjectQuaternion(int objectHandle, int/(const char*) relObjHandle, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame we want the orientation. Specify -1 to retrieve the absolute orientation, "sim.handle_parent" to retrieve the orientation relative to the object's parent, or an object handle relative to whose reference frame you want the orientation. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[4]): The (Qx,Qy,Qz,Qw) quaternion of the object
See also
Other languages

simxGetObjectSelection

Description Retrieves all selected object handles
synopsis std::vector<msgpack::object>* simxGetObjectSelection(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[]): The handles of the selected objects
See also
Other languages

simxGetObjectStringParam

Description Retrieves a string parameter of an object
synopsis std::vector<msgpack::object>* simxGetObjectStringParam(int objectHandle, int/(const char*) parameterID, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to retrieve, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): The retrieved parameter
See also
Other languages

simxGetObjectVelocity

Description Reads the linear and angular velocity of an object. The velocity is a measured velocity (i.e. from one simulation step to the next)
synopsis std::vector<msgpack::object>* simxGetObjectVelocity(int handle, const char* topic)
Parameters
handle: The handle of the object
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float[3]): The linear velocity
item3 (float[3]): The angular velocity vector, i.e. its direction represents the rotation axis, its length the rotation velocity
See also
sim.getObjectVelocity (regular API)
Other languages

simxGetObjects

Description Retrieves object handles from the scene
synopsis std::vector<msgpack::object>* simxGetObjects(int/(const char*) objectType, const char* topic)
Parameters
objectType: The object type, or "sim.handle_all" to retrieve all object handles in the scene. See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[]): The object handles
See also
Other languages

simxGetObjectsInTree

Description Retrieves object handles in a given hierarchy tree
synopsis std::vector<msgpack::object>* simxGetObjectsInTree(int/(const char*) treeBaseHandle, const char* objectType, int options, const char* topic)
Parameters
treeBaseHandle: The handle of the object that describes the hierarchy tree, or the string "sim.handle_scene" for all objects in the scene. See also simxEvaluateToInt
objectType: The object type to retrieve, or 'sim.handle_all' for any type of object in the tree
options: Bit-coded. bit0 set (1): exclude the tree base from the returned array, bit1 set (2): include in the returned array only the object's first children. If treeBaseHandle is 'sim.handle_scene', then only parentless objects will be included
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[]): The object handles
See also
Other languages

simxGetServerTimeInMs

Description Retrieves the current server time, in milliseconds
synopsis std::vector<msgpack::object>* simxGetServerTimeInMs(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The server time. On Windows is equivalent to the TimeGetTime() function, on Linux it is equivalent to the gettimeofday() function.
See also
Other languages

simxGetSimulationState

Description Retrieves the state of the simulation
synopsis std::vector<msgpack::object>* simxGetSimulationState(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The simulation state: 0=stopped, 8=paused, 16=running
See also
Other languages

simxGetSimulationStepDone

Description Checks whether the current simulation step finished executing
synopsis void simxGetSimulationStepDone(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call. Recommended is simxDefaultSubscriber
return
See also
Other languages

simxGetSimulationStepStarted

Description Checks whether the current simulation step finished executing
synopsis void simxGetSimulationStepStarted(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call. Recommended is simxDefaultSubscriber
return
See also
Other languages

simxGetSimulationTime

Description Retrieves the current simulation time
synopsis std::vector<msgpack::object>* simxGetSimulationTime(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The simulation time in seconds
See also
Other languages

simxGetSimulationTimeStep

Description Retrieves the current simulation time step
synopsis std::vector<msgpack::object>* simxGetSimulationTimeStep(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (float): The simulation time step in seconds
See also
Other languages

simxGetStringParam

Description Retrieves a string parameter
synopsis std::vector<msgpack::object>* simxGetStringParam(int/(const char*) paramId, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.stringparam_scene_name". See also simxEvaluateToInt
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (string): The value of the parameter
See also
Other languages

simxGetStringSignal

Description Retrieves a string signal. Such a signal represents a byte buffer
synopsis std::vector<msgpack::object>* simxGetStringSignal(const char* sigName, const char* topic)
Parameters
sigName: The name of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (byte[]): The value of the signal, or nil if the signal does not exist
See also
Other languages

simxGetTimeInMs

Description Returns the system time in milliseconds
synopsis long simxGetTimeInMs()
Parameters
return
The time in milliseconds
See also
Other languages

simxGetVisionSensorDepthBuffer

Description Retrieves the depth buffer of a vision sensor
synopsis std::vector<msgpack::object>* simxGetVisionSensorDepthBuffer(int objectHandle, bool toMeters, bool asByteArray, const char* topic)
Parameters
objectHandle: The handle of the vision sensor
toMeters: Whether depth values are expressed in terms of relative distance to the sensor's clipping planes or whether depth values are expressed in terms of distance in meters
asByteArray: If true, then a byte array will be returned, instead of a float array, which is much faster (large float arrays might be very slow to handle with message pack, in several languages). In that case, the user is in charge of correctly decoding the byte array containing 4-byte floats, including little/big Endian conversions, etc.
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[2]): The resolution of the depth buffer
item3 (float[]): The depth buffer. Values are in the range of 0-1 (0=on the near clipping plane, 1=on the far clipping plane). If toMeters was specified, then values represent the distance from the sensor's origin, in meters
See also
Other languages

simxGetVisionSensorImage

Description Retrieves the image of a vision sensor
synopsis std::vector<msgpack::object>* simxGetVisionSensorImage(int objectHandle, bool greyScale, const char* topic)
Parameters
objectHandle: The handle of the vision sensor
greyScale: Whether the image should be grey scale or color
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int[2]): The resolution of the image
item3 (byte[]): The image. In a grey scale image, each pixel is represented by one byte, with a color image, each pixel is represented by a RGB-byte-triplet
See also
Other languages

simxLoadModelFromBuffer

Description Loads a model from a buffer
synopsis std::vector<msgpack::object>* simxLoadModelFromBuffer(const char* buffer_data,size_t buffer_charCnt, const char* topic)
Parameters
buffer: The buffer representing the model to load
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the model base object
See also
Other languages

simxLoadModelFromFile

Description Loads a model from file
synopsis std::vector<msgpack::object>* simxLoadModelFromFile(const char* filename, const char* topic)
Parameters
filename: The location of the model file. The filename extension is required
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The handle of the model base object
See also
Other languages

simxLoadScene

Description Loads a scene from file
synopsis std::vector<msgpack::object>* simxLoadScene(const char* filename, const char* topic)
Parameters
filename: The location of the scene file. The filename extension is required
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 if operation was not successful
See also
Other languages

simxPauseSimulation

Description Requests a pause of the running simulation
synopsis std::vector<msgpack::object>* simxPauseSimulation(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the operation could not be performed. >0 in case of success
See also
Other languages

simxReadCollision

Description Deprecated. See simxCheckCollision instead.
synopsis std::vector<msgpack::object>* simxReadCollision(int handle, const char* topic)
Parameters
handle: The handle of the collision object
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (bool): The collision state of the object
item3 (int[2]): handles of the colliding objects
See also
Other languages

simxReadDistance

Description Deprecated. See simxCheckDistance instead.
synopsis std::vector<msgpack::object>* simxReadDistance(int handle, const char* topic)
Parameters
handle: The handle of the distance calculation object
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if distance was not yet computed, 1 otherwise
item3 (float): The smallest distance
See also
Other languages

simxReadForceSensor

Description Reads the force and torque applied to a force sensor (filtered values are read), and its current state ('unbroken' or 'broken')
synopsis std::vector<msgpack::object>* simxReadForceSensor(int handle, const char* topic)
Parameters
handle: The handle of the force sensor
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The sensor state (bit coded: bit0 set=force/torque data is valid, bit1 set=force sensor is broken)
item3 (float[3]): The applied force
item4 (float[3]): The applied torque
See also
sim.readForceSensor (regular API)
Other languages

simxReadProximitySensor

Description Reads the calculation result of a proximity sensor
synopsis std::vector<msgpack::object>* simxReadProximitySensor(int handle, const char* topic)
Parameters
handle: The handle of the proximity sensor
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): detection state (0 or 1)
item3 (float): The distance to the detected point
item4 (float[3]): The detected point relative to the sensor frame
item5 (int): The detected object handle
item6 (float[3]): The normal vector of the detected surface, relative to the sensor frame
See also
Other languages

simxReadVisionSensor

Description Reads the state of a vision sensor
synopsis std::vector<msgpack::object>* simxReadVisionSensor(int handle, const char* topic)
Parameters
handle: The handle of the vision sensor
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): detection state (0 or 1)
item3 (float[]): The default auxiliary value packet. See [L[regularApi/simReadVisionSensor.htm,here] for details
item4 (float[]): Additional auxiliary value packet (e.g. from an image processing component)
item5 (float[]): Etc.
See also
Other languages

simxRemoveDrawingObject

Description Removes a drawing object from the scene
synopsis std::vector<msgpack::object>* simxRemoveDrawingObject(int handle, const char* topic)
Parameters
handle: The drawing object handle to remove
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxRemoveObjects

Description Removes objects or models
synopsis std::vector<msgpack::object>* simxRemoveObjects(const int* objectHandles_data,size_t objectHandles_intCnt, int options, const char* topic)
Parameters
objectHandles: The handles of the objects/models to remove
options: Bit-coded. If bit0 is set (i.e. 1), then whole models will be removed. If bit1 is set (i.e. 2), then all objects and models will be removed
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): The number of removed objects
See also
sim.removeObject (regular API)
sim.removeModel (regular API)
Other languages

simxRemovePublisher

Description Removes or disables a custom publisher
synopsis void simxRemovePublisher(const char* topic)
Parameters
topic: The topic of the publisher
return
See also
Other languages

simxRemoveSubscriber

Description Removes or disables a subscriber
synopsis void simxRemoveSubscriber(const char* topic)
Parameters
topic: The topic of the subscriber
return
See also
Other languages

simxServiceCall

Description Returns the topic for service calls
synopsis const char* simxServiceCall()
Parameters
return
The service call topic
See also
Other languages

simxSetArrayParam

Description Sets a float parameter
synopsis std::vector<msgpack::object>* simxSetArrayParam(int/(const char*) paramId, const float paramVal[3], const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.arrayparam_gravity". See also simxEvaluateToInt
paramVal: The value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetBoolParam

Description Sets a bool parameter
synopsis std::vector<msgpack::object>* simxSetBoolParam(int/(const char*) paramId, bool paramVal, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.boolparam_dynamics_handling_enabled". See also simxEvaluateToInt
paramVal: The value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetFloatParam

Description Sets a float parameter
synopsis std::vector<msgpack::object>* simxSetFloatParam(int/(const char*) paramId, float paramVal, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.floatparam_simulation_time_step". See also simxEvaluateToInt
paramVal: The value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetFloatSignal

Description Sets a float signal
synopsis std::vector<msgpack::object>* simxSetFloatSignal(const char* sigName, float sigValue, const char* topic)
Parameters
sigName: The name of the signal
sigValue: The value of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetInt32Param

Description Sets an integer parameter
synopsis std::vector<msgpack::object>* simxSetInt32Param(int/(const char*) paramId, int paramVal, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.intparam_program_version". See also simxEvaluateToInt
paramVal: The value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetInt32Signal

Description Sets an int signal
synopsis std::vector<msgpack::object>* simxSetInt32Signal(const char* sigName, int sigValue, const char* topic)
Parameters
sigName: The name of the signal
sigValue: The value of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetJointForce

Description Deprecated. Use simxSetJointMaxForce instead
synopsis std::vector<msgpack::object>* simxSetJointForce(int jointHandle, float forceOrTorque, const char* topic)
Parameters
jointHandle: The handle of the joint
forceOrTorque: The maximum force or torque that the joint can exert
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetJointMaxForce

Description Sets the maximum force or torque that a joint can exert
synopsis std::vector<msgpack::object>* simxSetJointMaxForce(int jointHandle, float forceOrTorque, const char* topic)
Parameters
jointHandle: The handle of the joint
forceOrTorque: The maximum force or torque that the joint can exert
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetJointPosition

Description Sets the intrinsic position of a joint
synopsis std::vector<msgpack::object>* simxSetJointPosition(int jointHandle, float position, const char* topic)
Parameters
jointHandle: The handle of the joint
position: The position of the joint, in radians or meters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetJointTargetPosition

Description Sets the target position of a joint
synopsis std::vector<msgpack::object>* simxSetJointTargetPosition(int jointHandle, float targetPos, const char* topic)
Parameters
jointHandle: The handle of the joint
targetPos: The target position of the joint, in radians or meters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetJointTargetVelocity

Description Sets the target velocity of a joint
synopsis std::vector<msgpack::object>* simxSetJointTargetVelocity(int jointHandle, float targetPos, const char* topic)
Parameters
jointHandle: The handle of the joint
targetPos: The target velocity of the joint, in radians/s or meters/s
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectFloatParam

Description Sets a floating point parameter of an object
synopsis std::vector<msgpack::object>* simxSetObjectFloatParam(int objectHandle, int/(const char*) parameterID, float parameter, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to set, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
parameter: The desired value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 in case of an error, 0 if the parameter could not be set
See also
Other languages

simxSetObjectInt32Param

Description Sets an integer parameter of an object
synopsis std::vector<msgpack::object>* simxSetObjectInt32Param(int objectHandle, int/(const char*) parameterID, int parameter, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to set, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
parameter: The desired value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 in case of an error, 0 if the parameter could not be set
See also
Other languages

simxSetObjectMatrix

Description Sets the transformation matrix of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before)
synopsis std::vector<msgpack::object>* simxSetObjectMatrix(int objectHandle, int/(const char*) relObjHandle, const float matr[12], const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame the matrix is specified. Specify -1 to set the absolute matrix, "sim.handle_parent" to set the matrix relative to the object's parent, or an object handle relative to whose reference frame the matrix is specified. See also simxEvaluateToInt
matr: The desired (Xx,Yx,Zx,Px,Xy,Yy,Zy,Py,Xz,Yz,Zz,Pz) transformation matrix
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectOrientation

Description Sets the orientation (in Euler angles) of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before)
synopsis std::vector<msgpack::object>* simxSetObjectOrientation(int objectHandle, int/(const char*) relObjHandle, const float euler[3], const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame the orientation is specified. Specify -1 to set the absolute orientation, "sim.handle_parent" to set the orientation relative to the object's parent, or an object handle relative to whose reference frame the orientation is specified. See also simxEvaluateToInt
euler: The desired (alpha,beta,gamma) Euler-angle orientation
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectParent

Description Gives an object a new parent object
synopsis std::vector<msgpack::object>* simxSetObjectParent(int objectHandle, int parentHandle, bool assembly, bool keepInPlace, const char* topic)
Parameters
objectHandle: The handle of the object
parentHandle: handle of the object that will become parent, or -1 if the object should become parentless
assembly: true if the two objects can be assembled via a predefined assembly transformation (refer to the assembling option in the object common properties). In that case, parentHandle can't be -1, and keepInPlace should be set to false
keepInPlace: indicates whether the object's absolute position and orientation should remain same
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 if the operation was not successful
See also
Other languages

simxSetObjectPose

Description Sets the pose (position + quaternion) of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before)
synopsis std::vector<msgpack::object>* simxSetObjectPose(int objectHandle, int/(const char*) relObjHandle, const float pose[7], const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame the pose is specified. Specify -1 to set the absolute pose, "sim.handle_parent" to set the pose relative to the object's parent, or an object handle relative to whose reference frame the pose is specified. See also simxEvaluateToInt
pose: The desired (X,Y,Z,Qx,Qy,Qz,Qw) pose
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectPosition

Description Sets the position of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before)
synopsis std::vector<msgpack::object>* simxSetObjectPosition(int objectHandle, int/(const char*) relObjHandle, const float position[3], const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame the position is specified. Specify -1 to set the absolute position, "sim.handle_parent" to set the position relative to the object's parent, or an object handle relative to whose reference frame the position is specified. See also simxEvaluateToInt
position: The desired (X,Y,Z) position
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectQuaternion

Description Sets the quaternion orientation of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before)
synopsis std::vector<msgpack::object>* simxSetObjectQuaternion(int objectHandle, int/(const char*) relObjHandle, float[4] quat, const char* topic)
Parameters
objectHandle: The handle of the object
relObjHandle: Indicates relative to which reference frame the orientation is specified. Specify -1 to set the absolute orientation, "sim.handle_parent" to set the orientation relative to the object's parent, or an object handle relative to whose reference frame the orientation is specified. See also simxEvaluateToInt
quat: The desired (Qx,Qy,Qz,Qw) quaternion orientation
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetObjectSelection

Description Sets the object selection state
synopsis std::vector<msgpack::object>* simxSetObjectSelection(const int* selection_data,size_t selection_intCnt, const char* topic)
Parameters
selection: The handles of the objects to be selected
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 if operation was not successful
See also
Other languages

simxSetObjectStringParam

Description Sets a string parameter of an object
synopsis std::vector<msgpack::object>* simxSetObjectStringParam(int objectHandle, int/(const char*) parameterID, const char* parameter, const char* topic)
Parameters
objectHandle: Handle of the object
parameterID: The identifier of the parameter to set, specified as number or string. See also the list of possible object parameter identifiers and simxEvaluateToInt
parameter: The desired value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): -1 in case of an error, 0 if the parameter could not be set
See also
Other languages

simxSetStringParam

Description Sets a string parameter
synopsis std::vector<msgpack::object>* simxSetStringParam(int/(const char*) paramId, const char* paramVal, const char* topic)
Parameters
paramId: The parameter identifier. Can also be a string value, e.g. "sim.stringparam_scene_name". See also simxEvaluateToInt
paramVal: The value of the parameter
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetStringSignal

Description Sets a string signal. Such a signal represents a byte buffer
synopsis std::vector<msgpack::object>* simxSetStringSignal(const char* sigName, const char* sigValue_data,size_t sigValue_charCnt, const char* topic)
Parameters
sigName: The name of the signal
sigValue: The value of the signal
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSetVisionSensorImage

Description Applies an image of a vision sensor
synopsis std::vector<msgpack::object>* simxSetVisionSensorImage(int objectHandle, bool greyScale, const char* img_data,size_t img_charCnt, const char* topic)
Parameters
objectHandle: The handle of the vision sensor
greyScale: Whether the provided image is grey scale or color
img: The image that must be provided in the same resolution as the vision sensor. In a grey scale image, each pixel is represented by one byte, with a color image, each pixel is represented by a RGB-byte-triplet
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
See also
Other languages

simxSleep

Description Waits for a certain duration
synopsis void simxSleep(int durationInMs)
Parameters
durationInMs: The sleep time in milliseconds
return
See also
Other languages

simxSpin

Description Handles all callbacks for subscribers that have messages waiting, in a loop (i.e. does not return)
synopsis void simxSpin()
Parameters
return
See also
Other languages

simxSpinOnce

Description Calls all callbacks for subscribers that have messages waiting, then returns
synopsis void simxSpinOnce()
Parameters
return
See also
Other languages

simxStartSimulation

Description Requests a start of a simulation (or a resume of a paused simulation)
synopsis std::vector<msgpack::object>* simxStartSimulation(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the operation could not be performed. >0 in case of success
See also
Other languages

simxStopSimulation

Description Requests a stop of the running simulation
synopsis std::vector<msgpack::object>* simxStopSimulation(const char* topic)
Parameters
topic: The topic or communication channel to use for executing the function call
return
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
item1 (bool): Whether the function was successfully called on the server side
item2 (int): 0 if the operation could not be performed. >0 in case of success
See also
Other languages

simxSynchronous

Description Enables/disables the CoppeliaSim stepping mode. In stepping mode, each simulation step will require an external trigger signal in order to be run
synopsis void simxSynchronous(bool enable)
Parameters
enable: The enable state of the synchonous mode
return
See also
Other languages

simxSynchronousTrigger

Description Triggers next simulation step, if the CoppeliaSim stepping mode was previously enabled
synopsis void simxSynchronousTrigger()
Parameters
return
See also
Other languages

Topics / Communication channels

simxServiceCall
simxDefaultPublisher
simxDefaultSubscriber
simxCreatePublisher
simxCreateSubscriber

Helper functions

static void b0RemoteApi::print(const std::vector* msg)
static bool b0RemoteApi::hasValue(const std::vector* msg)
static bool b0RemoteApi::readBool(std::vector* msg,
    int pos,bool* success=nullptr)
static int b0RemoteApi::readInt(std::vector* msg,
    int pos,bool* success=nullptr)
static float b0RemoteApi::readFloat(std::vector* msg,
    int pos,bool* success=nullptr)
static double b0RemoteApi::readDouble(std::vector* msg,
    int pos,bool* success=nullptr)
static std::string b0RemoteApi::readString(std::vector* msg,
    int pos,bool* success=nullptr)
static std::string b0RemoteApi::readByteArray(std::vector* msg,
    int pos,bool* success=nullptr)
static bool b0RemoteApi::readIntArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readFloatArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readDoubleArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readStringArray(std::vector* msg,
    std::vector& array,int pos)