## Placing coloured circles on the ground

Typically: "How do I... ", "How can I... " questions
RobAtLab
Posts: 86
Joined: 10 Jan 2018, 17:49

### Placing coloured circles on the ground

How can I get robots be able to lay down coloured circles on the ground which other robots can then detect with a vision sensor as they drive over, I guess this is related to how your drawing line marker model works but don't quite understand it's principle of operation. Also is there an easy way that robots can, when they detect such a coloured dot (a circle of particular radius centred on the point where it was dumped down), erase it to get that section of floor back to the usual colour? Also would there be any way to make the placed coloured dots fade away with time after being put down? And any way to place some dots at arbitrary floor co-ordinates from a script running on a dummy object, rather than simply on the pieces of floor being driven opver by a robot?

Thanks

I'm using V-REP 3.5 but assume that the ways of doing these things should still be the same in 3.6.2 and the new coppeliaSim program.

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

### Re: Placing coloured circles on the ground

Hello,

I think the easiest would be to dynamically generate a shape at the location where you want to place a color patch, e.g. with sim.createPureShape. You can the position/orient that shape accordingly, and change its color via sim.setShapeColor. If that shape has the appropriate special properties (sim.setObjectSpecialProperty) it can be seen by vision sensors, but also detected by proximity sensors. When the color path is not needed anymore, simply remove it with sim.removeObject.

Cheers

RobAtLab
Posts: 86
Joined: 10 Jan 2018, 17:49

### Re: Placing coloured circles on the ground

I've just tried this, I get an error:

One of the function's argument type is not correct. (sim.createPureShape)

when I try to do:

local SizeTable={0.1,0.1,0.0001}
local PrecTable={12,12}
local FoodHandle=sim.createPureShape(2,18,sizeTable,0,PrecTable)

to make a flattened cylinder, edges marked, massless,non dynamic and non-respondable. All my arguemnts seem to agree with:

number objectHandle=sim.createPureShape(number primitiveType,number options,table_3 sizes,number mass,table_2 precision=nil)

on the APIUwebpage, What am I doing wong? Thanks

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

### Re: Placing coloured circles on the ground

RobAtLab wrote:
07 Sep 2020, 16:18
local SizeTable={0.1,0.1,0.0001}
local PrecTable={12,12}
local FoodHandle=sim.createPureShape(2,18,sizeTable,0,PrecTable)
misspelled variable name

RobAtLab
Posts: 86
Joined: 10 Jan 2018, 17:49

### Re: Placing coloured circles on the ground

Thanks, very silly error on my part.