Page 1 of 1

Heat Path (Expand and decrease during simulation and generator path)

Posted: 19 Dec 2019, 12:38
by afik
I want to create a mobile robot that follows the heat path. And I have a few questions about it because as I found out I can create a temperature sensor using a vision sensor by auxiliary component but my questions are about the path.

Is it possible to create such a path that after a while would begin to decrease in the auxiliary red, showing the natural process of cooling the path, or would it be possible for this path to expand width to show that heat is spreading sideways?

The last question is is there perhaps a path generator that would create a path extension while the simulation is running?

Re: Heat Path (Expand and decrease during simulation and generator path)

Posted: 31 Dec 2019, 07:40
by coppelia
Hello,

sorry for the delay. This is not directly something that is supported. You could try to apply a single texture to a floor object, and modify that texture on the go, e.g. with sim.writeTexture.

Cheers

Re: Heat Path (Expand and decrease during simulation and generator path)

Posted: 26 Jan 2020, 01:06
by afik
Ok Thanks :)
And do you have any example use of this function in your project? Or maybe a tutorial for this function because I'm trying to do some texture with several levels but unfortunately It don't work.
Thank you in advance

Re: Heat Path (Expand and decrease during simulation and generator path)

Posted: 27 Jan 2020, 19:45
by coppelia
Hello,

you can write some code, and we'll try to correct it.

Cheers

Re: Heat Path (Expand and decrease during simulation and generator path)

Posted: 28 Jan 2020, 11:03
by fferri
afik wrote: 26 Jan 2020, 01:06 Ok Thanks :)
And do you have any example use of this function in your project? Or maybe a tutorial for this function because I'm trying to do some texture with several levels but unfortunately It don't work.
Thank you in advance
Writing a texture is as simple as this:

Code: Select all

plane=sim.getObjectHandle('Plane')
viz=sim.getShapeViz(plane,0) 
data={}
for i=1,128 do -- 1st dimension
    for j=1,128 do -- 2nd dimension
        for h=1,3 do -- 3 channels (RGB)
            grayValue=math.floor((i-64)*(i-64)*(j-64)*(j-64)*255/64/64/64/64)
            table.insert(data,grayValue)
        end
    end
end 
sim.writeTexture(viz.texture.id,0,sim.packUInt8Table(data),0,0,0,0,0)
note that I previously created a plane object in the scene named 'Plane' and assigned a 128x128 texture to it