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

Typically: "How do I... ", "How can I... " questions
Post Reply
afik
Posts: 2
Joined: 19 Dec 2019, 01:11

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

Post 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?

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

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

Post 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

afik
Posts: 2
Joined: 19 Dec 2019, 01:11

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

Post 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

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

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

Post by coppelia »

Hello,

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

Cheers

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

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

Post 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

Post Reply