Laser profile missing

Typically: "How do I... ", "How can I... " questions
Post Reply
Adranos
Posts: 6
Joined: 27 May 2021, 07:47

Laser profile missing

Post by Adranos »

Hello Dear,

I apply a laser profile to railway wheel,

In scene window, laser is become as wheel profile

But, in vision sensor window, profile isn't seem correctly.

What should I do?

https://github.com/Adranos16/CoppeliaSi ... rofile.JPG

Best Regards

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Laser profile missing

Post by coppelia »

Hello,

not sure I exactly understand...
So you have placed a vision sensor at the exact same location and orientation as a laser sensor, and are wondering why the vision sensor doesn't show a straight, uninterrupted line? Did you try to set the same resolution and view angle to your vision sensor.
Additionally, posting the scene file instead would be more useful, since then we can have a look at it.

Cheers

Adranos
Posts: 6
Joined: 27 May 2021, 07:47

Re: Laser profile missing

Post by Adranos »

Hello,

Actually I created my own sensor with using laser source and vision sensor.

I can see the created laser profile on main window; but I can't see on vision sensor window.

You can find the scene in below link:

https://github.com/Adranos16/CoppeliaSi ... /AWPMS.ttt

Thanks

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Laser profile missing

Post by coppelia »

Ok, now I understand. The main reason to that is that the vision sensor is handled before the laser scanner script's sensing section, i.e. the main script does:

Code: Select all

...
function sysCall_sensing()
    ...
    sim.handleProximitySensor(sim.handle_all_except_explicit)
    sim.handleVisionSensor(sim.handle_all_except_explicit)
    sim.handleChildScripts(sim.syscb_sensing)
    ...
end
...
So the image of the vision sensor is first rendered, then the laser points are added (and will only appear in next simulation step). So there is one simulation step difference.

You need to have your vision sensor handled after the laser scanner script. You could do this by modifying the main script, but this is really not recommended, since you will lose compatibility with the default behaviour. Much better is following approach:
  • Set your vision sensor in Explicit handling, see the vision sensor's dialog
  • Now you need to explicitely handle it in each simulation step. Attach a child script to the vision sensor, with following code:

Code: Select all

function sysCall_init()
    h=sim.getObjectHandle(sim.handle_self)
end

function sysCall_sensing()
    sim.handleVisionSensor(h)
end
  • Now make sure that the vision sensor script is handled after the laser scanner script: in the script dialog, select the vision sensor script, then adjust its execution priority to last. Make sure you also understand the overall script execution order.
Cheers

Adranos
Posts: 6
Joined: 27 May 2021, 07:47

Re: Laser profile missing

Post by Adranos »

Hello Dear,

I tried it and it works! thanks a lot.

But there is one more:

Laser profile is become correctly as below:

https://github.com/Adranos16/CoppeliaSi ... rofile.JPG

But it usually interrupts as below:

https://github.com/Adranos16/CoppeliaSi ... rofile.JPG

I mean, laser is not continues it is flashing.

It may be occurs because of proximity sensor, it is like sensing both frontside and backside.

This interrupt can be occured while it is sensing backside.

How can I do it continues?

Best Regards

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Laser profile missing

Post by coppelia »

This is due because of how that laser scanner operates: it is a simple ray-type proximity sensor mounted on top of a revolute joint. Check the attached child script to see where you can adjust the scanning speed. Best is to have it scan exactly one pass per simulation step.

Cheers

Post Reply