Search found 5908 matches

by coppelia
05 Nov 2024, 17:38
Forum: General questions
Topic: Import a custom python library
Replies: 10
Views: 2895

Re: Import a custom python library

#luaExec sim = require('sim') #luaExec additionalPaths = {sim.getStringProperty(sim.handle_app, 'scenePath')} from myModule import myFunction def sysCall_init(): sim = require('sim') print('starting') myFunction(sim) In your myModule.py, e.g.: import datetime def myFunction(sim): sim.addLog(sim.ver...
by coppelia
05 Nov 2024, 10:10
Forum: General questions
Topic: PID issue, robot doesn't pass maze
Replies: 3
Views: 90

Re: PID issue, robot doesn't pass maze

Debugging your algorithm would be too time intensive. There are virtually an infinite number of ways to do this with those 3 sensors. However using 3 ray-type sensors only is very little to safely navigate a maze. You can see in the very first half meter of your maze that something is not right with...
by coppelia
05 Nov 2024, 10:01
Forum: General questions
Topic: Abnormal Trajectories in Cluttered Environments Using Toppra
Replies: 1
Views: 58

Re: Abnormal Trajectories in Cluttered Environments Using Toppra

Hello, the important thing is to first make sure OMPL doesn't produce a path that collides. To that end, make sure that the arm or object can't jump over obstacles because two adjacent collision-free nodes are too far away. You will have to play with the state validity checking resolution (i.e. adju...
by coppelia
05 Nov 2024, 09:47
Forum: General questions
Topic: Import a custom python library
Replies: 10
Views: 2895

Re: Import a custom python library

Hello, you can either place the import instuctions inside the init section, after sim=require('sim'), or you can do following at the very top of your Python script: #luaExec sim = require('sim') #luaExec additionalPaths = {sim.getStringProperty(sim.handle_app, 'scenePath')} or with a CoppeliaSim ver...
by coppelia
04 Nov 2024, 16:57
Forum: General questions
Topic: Multiple script objects enabling on the fly
Replies: 5
Views: 66

Re: Multiple script objects enabling on the fly

normally not. There must be something else happening in there. Try to debug with some print statements...

Cheers
by coppelia
04 Nov 2024, 16:56
Forum: General questions
Topic: Include multiple python files
Replies: 3
Views: 63

Re: Include multiple python files

I think the only way would be to include a single file, that itself imports several files...

Cheers
by coppelia
04 Nov 2024, 16:26
Forum: General questions
Topic: Multiple script objects enabling on the fly
Replies: 5
Views: 66

Re: Multiple script objects enabling on the fly

Hello,

there should be no problem in enabling/disabling a script on-the-fly:

Code: Select all

sim.setBoolProperty(scriptObjectHandle, 'scriptDisabled', disableState)
(above uses properties that were introduced in CoppeliaSim V4.8)

If a script needs to restart, simply call sim.initScript

Cheers
by coppelia
04 Nov 2024, 13:31
Forum: General questions
Topic: Include multiple python files
Replies: 3
Views: 63

Re: Include multiple python files

Hello,

use the include directive if your script code is located in an external file. If not, do not use include, but rather the usual import (and then you can import n modules if desired).

Cheers
by coppelia
04 Nov 2024, 09:24
Forum: General questions
Topic: How to run multiple instances in newest version of CoppeliaSim
Replies: 9
Views: 1744

Re: How to run multiple instances in newest version of CoppeliaSim

Hello Marco, have a look at the demo Python script in programming/zmqRemoteApi/clients/python/simpleMovement.py : in there, 4 distinct connections to CoppeliaSim are created (one from the main thread, and 3 from auxiliary threads). For CoppeliaSim those are like 4 individual clients that connect to ...
by coppelia
04 Nov 2024, 09:17
Forum: General questions
Topic: Unresponsive gripper when attached to Robot
Replies: 3
Views: 92

Re: Unresponsive gripper when attached to Robot

not sure what is wrong exactly, since your scene is not self-sufficient as it seems. Just a few points: you haven't enabled the stepping mode. Make sure you do that at the beginning, so that you can run synchronously, otherwise you might run less than 1 movement step per simulation step. Just call s...