Hii
I would like to use a gas sensor to tap the concentration and make the
mobile robot decide its course in the arena. How it can be done? Is it
possible to simulate a plume dispersion and record its concentration
with a gas sensor?
Gas sensors in CoppeliaRobotics
Re: Gas sensors in CoppeliaRobotics
Hello,
the best you can do is have a function the will compute a concentration wased on a 3D position, e.g.:
Then, as your robot moves in the 3D space, you can get a computed gas concentration based on the robot's position e.g. obtained with sim.getObjectPosition.
Cheers
the best you can do is have a function the will compute a concentration wased on a 3D position, e.g.:
Code: Select all
function getConcentration(pos)
return(pos[1]+pos[2]+pos[3])
end
Cheers
-
- Posts: 3
- Joined: 04 Jul 2023, 10:55
Re: Gas sensors in CoppeliaRobotics
Hi!! Thanks for response. For a while, I was not active on the forum. I have a case that needs plume simulation and tapping the odor concentration with gas sensor. Can the plume simulation is possible alongwith measurement of concentration at different locations with a mobile robot?coppelia wrote: ↑05 Jul 2023, 14:54 Hello,
the best you can do is have a function the will compute a concentration wased on a 3D position, e.g.:
Then, as your robot moves in the 3D space, you can get a computed gas concentration based on the robot's position e.g. obtained with sim.getObjectPosition.Code: Select all
function getConcentration(pos) return(pos[1]+pos[2]+pos[3]) end
Cheers
Hope my question will be addressed?
Re: Gas sensors in CoppeliaRobotics
Yes.
You would compute the diffusion model yourself e.g. in sysCall_actuation() updating C[x][y][z] (the gas concentration at position x, y, z) using whatever diffusion model and environment parameters you wish.
e.g.
then from another script (e.g. from robot's script) you can call the
You would compute the diffusion model yourself e.g. in sysCall_actuation() updating C[x][y][z] (the gas concentration at position x, y, z) using whatever diffusion model and environment parameters you wish.
e.g.
Code: Select all
-- lua
function sysCall_init()
C = ... -- create new 3D grid
end
function sysCall_actuation()
C_new = table.deepcopy(C)
for i = 2, nx-1 do
for j = 2, ny-1 do
for k = 2, nz-1 do
-- Update concentration
C_new[i][j][k] = C_new[i][j][k] + ... -- C[i][j][k] is the concentration at previous step
end
end
end
C = C_new
end
function getConcentration(x, y, z)
local i = ...
local j = ...
local k = ...
return C[i][j][k]
end
getConcentration(x, y, z)
function, using sim.callScriptFunction or sim.getScriptFunctions-
- Posts: 3
- Joined: 04 Jul 2023, 10:55
Re: Gas sensors in CoppeliaRobotics
Thanks for reply. Is it possible to visualize the plume simulation in coppeliaSim?
Re: Gas sensors in CoppeliaRobotics
Yes, you can use OcTrees, Point Clouds or Drawing Objects, and their relative APIs.
However with a dense scalar field like this, it would be difficult to look at the whole field at once. Probably you want to look at it one particular 2D slice at a time.
However with a dense scalar field like this, it would be difficult to look at the whole field at once. Probably you want to look at it one particular 2D slice at a time.