Report crashes, strange behaviour, or apparent bugs
lyz
Posts: 46
Joined: 07 Mar 2019, 07:34

Hi coppelia,
Recently, I am using the Headless Mode to load my scene, and I noticed that sysCall_actuation functions don't run all the time. Is that the theory? GUI mode is always running.

coppelia
Posts: 7911
Joined: 14 Dec 2012, 00:25

Hello Lyz,

no, that is not normal. Can you describe in which situation exactly? Or do you have a minimalistic scene that illustrates this?

Cheers

lyz
Posts: 46
Joined: 07 Mar 2019, 07:34

Hi coppelia,
This is my test scene. Normally, when I publish the door_switch True topic, the door opens, and then coppeliaSim publish the door_status is true. This is right in the GUI mode, but in Headless mode it doesn't publish the door status. why?

Code: Select all

rostopic pub /door_switch std_msgs/Bool "data: true"

rostopic echo /door_status

test.ttt: https://1drv.ms/u/s!AtF26DukM1J6hAw6r1w ... E?e=kuLAtJ

coppelia
Posts: 7911
Joined: 14 Dec 2012, 00:25

This is because following is causing an error in headless mode:

Code: Select all

        flyModeCameraHandle=sim.getInt32Parameter(sim.intparam_flymode_camera_handle)
i.e. because flymode doesn't make sense in headless mode. Remove that and a few of the lines below, and it should work fine. You can test if in headless mode with:

Code: Select all

sim.getBoolParameter(sim.boolparam_headless)
In Next release (beta is already available here) you can start CoppeliaSim with -vverbosity argument, and with -vscripterrors it will also print script errors to the console, that will be easier to debug. (currently, you can use variable redirectStatusbarMsgToConsoleInHeadlessMode in file system/usrset.txt for that purpose, but better use the new method with the -v option).

oh.. and your main script looks very strange. It still uses the old way of calling sections. Try to stick to the default main script, or at least use the sysCall_init, etc. -type of functions ;)

Cheers

lyz
Posts: 46
Joined: 07 Mar 2019, 07:34