CoppeliaSim 4.3.0 User Manual - CoppeliaSim 4.3.0 使用者手冊

  • Home
    • Site Map
    • reveal
    • blog
  • welcome
  • userInterface
    • pagesAndViews
    • coordinateDialog
    • positionDialog
    • orientationDialog
    • objectMovement
    • positionOrientationTransformation
    • settings
    • shortcuts
  • scenesAndModels
    • scenes
    • models
    • modelDialog
  • environment
    • environmentPropertiesDialog
    • textureDialog
  • entities
    • collections
    • objects
      • sceneObjectPropertiesDialog
      • commonPropertiesDialog
    • collidableObjects
    • measurableObjects
    • detectableObjects
    • viewableObjects
    • convexHull
    • layerSelectionDialog
      • cameras
      • cameraPropertiesDialog
      • lights
      • lightPropertiesDialog
      • shapes
      • shapeReferenceFrames
      • primitiveShapes
      • convexDecomposition
      • shapeProperties
      • shapeDynamicsProperties
      • shapeDynamicEngineProperties
      • geometryDialog
      • shapeEditModes
      • triangleEditMode
      • vertexEditMode
      • edgeEditMode
      • groupedShapeEditMode
      • joints
      • jointModes
      • jointProperties
      • jointDynamicsProperties
      • jointDynamicEngineProperties
      • dummies
      • dummyPropertiesDialog
      • graphs
      • graphPropertiesDialog
      • proximitySensors
      • proximitySensorDescription
      • proximitySensorPropertiesDialog
      • proximitySensorVolumeDialog
      • proximitySensorDetectionParameterDialog
      • visionSensors
      • visionSensorDescription
      • visionSensorPropertiesDialog
      • forceSensors
      • forceSensorPropertiesDialog
      • octrees
      • octreePropertiesDialog
      • pointClouds
      • pointCloudPropertiesDialog
    • paths
  • functionality
    • geometricCalculations
    • collisionDetection
    • distanceCalculation
      • geometricPlugin
      • simGeom API
      • coppeliaGeometricRoutines
      • CoppeliaGeometricRoutinesAPI
    • IGLPluginAPIreference
    • kinematics
    • basicsOnIkGroupsAndIkElements
    • solvingIkAndFk
      • kinematicsPlugin
      • simIKAPI
      • coppeliaKinematicsRoutines
      • CoppeliaKinematicsRoutinesAPI
    • dynamicsModule
    • designingDynamicSimulations
      • dynamicsDialog
      • dynamicsEngineDialog
    • dataVisualizationAndOutput
    • externalFrontEnd
    • dataTransformation
    • meansOfCommunication
      • remoteApiOverview
      • zmqRemoteApiOverview
      • wsRemoteApiOverview
      • rosInterfaces
      • rosInterf
      • ROSPluginAPIreference
      • ros2Interface
      • ROS2PluginAPIreference
    • ZMQPluginAPIreference
    • WSPluginAPIreference
    • pathsAndTrajectories
    • pathAndMotionPlanningModules
    • OMPLPluginAPIreference
    • syntheticVision
    • IMPluginAPIreference
    • simVisionAPI
    • customUIPlugin
    • UIPluginAPIreference
    • simUI-widgets
    • QMLPluginAPIreference
    • importExport
    • xmlFormat
      • urdfPlugin
      • APIFunctions
      • sdfPlugin
      • SDFPluginAPIreference
    • aviRecorder
    • AssimpPluginAPIreference
    • GLTFPluginAPIreference
      • commandLine
      • LuaCmdPluginAPIreference
      • miscellaneousFunctionality
      • SurfRecPluginAPIreference
      • ICPPluginAPIreference
      • SubprocessPluginAPIreference
  • writingCode
    • scripts
      • embeddedScripts
      • simulationScripts
      • mainScript
      • childScripts
      • customizationScripts
      • scriptProperties
      • scriptEditor
    • addOns
    • sandboxScript
    • scriptExecution
    • threadedAndNonThreadedCode
      • callbackFunctions
      • dynCallbackFunctions
      • jointCallbackFunctions
      • contactCallbackFunction
      • visionCallbackFunctions
      • triggerCallbackFunctions
      • userConfigCallbackFunctions
    • luaPythonDifferences
    • luaCrashCourse
    • plugins
    • mainClientApplication
    • accessingSceneObjects
    • explicitHandling
    • apisOverview
      • apiFunctions
      • apiConstants
      • objectParameterIDs
  • simulation
    • simulationPropertiesDialog
  • tutorials
    • bubbleRobTutorial
    • buildingAModelTutorial
    • lineFollowingBubbleRobTutorial
    • inverseKinematicsTutorial
    • externalControllerTutorial
    • pluginTutorial
    • robotLanguageIntegrationTutorial
    • rosTutorial
      • ros1Tutorial
      • ros2Tutorial
    • compilingCoppeliaSim
scriptEditor << Previous Next >> sandboxScript

addOns

Add-ons

An add-on is a script running in CoppeliaSim, that can act in a similar way as a plugin: it is automatically loaded at program start-up, and allows CoppeliaSim's functionality to be extended by user-written functionality or functions; it persists across all opened scenes, and is executed constantly, effectively running in the background. Add-ons can run threaded or non-threaded, should be segmented into several system callback functions, and follow a precise execution order in relation with other script types. They share a lot of properties with the sandbox script.

Add-ons should be written in a text file located in the same folder as the main application, with following naming convention: simAddOnXXXX.lua (even add-ons containing Python code). Add-ons that do not follow above naming convention can still be loaded and run via command line options.

By default, add-ons will automatically start when CoppeliaSim starts, e.g.:

function sysCall_init()
    print("Executing the initialization section. Starting together with CoppeliaSim")
end

function sysCall_addOnScriptSuspend()
print("Ending... (triggered by the user)") return {cmd='cleanup'} -- end this add-on. The cleanup section will be called
end function sysCall_cleanup() print("Executing the clean-up section") end

An add-on can also be manually started and stopped from the add-on menu (Lua only), e.g.:

function sysCall_info()
return {autoStart=false}
end function sysCall_init() print("Executing the initialization section. Start triggered by the user") end function sysCall_addOnScriptSuspend()
print("Ending... (triggered by the user)") return {cmd='cleanup'} -- end this add-on.
end

An add-on can also be suspended/resumed from the add-on menu, e.g.:

...

function sysCall_addOnScriptSuspend()
print("Suspending the add-on... (triggered by the user)") end function sysCall_addOnScriptResume()
print("Resuming the add-on... (triggered by the user)") end ...

An add-on can also act as a simple function triggered by the user (Lua only), e.g.:

function sysCall_info()
return {autoStart=false}
end function sysCall_init() print("Executing the initialization section. Start triggered by the user") -- execute some functions here, e.g. import something return {cmd='cleanup'} -- end this add-on. end

An add-on can also display a customized name in the Modules' menu (Lua only), e.g.:

function sysCall_info()
return {menu='Exporters//My exporter'}
end

For more information about add-ons, have a look at the add-ons located in the installation folder.




scriptEditor << Previous Next >> sandboxScript

Copyright © All rights reserved | This template is made with by Colorlib