## simOMPL.createStateSpace()

Typically: "How do I... ", "How can I... " questions
Jas
Posts: 6
Joined: 11 Sep 2018, 08:20

### simOMPL.createStateSpace()

dear all
Sorry for this question but I could not find the meaning of
local j3_space=simOMPL.createStateSpace('j3_space',simOMPL.StateSpaceType.joint_position,jh[3],{-170*math.pi/180},{170*math.pi/180},3)
particularly the the last index 3. In OMPL plugin the function simOMPL.createStateSpace(), it states that 3 stands foruse ForProjection (int): if true, this object position or joint value will be used for computing a default projection.

,

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

### Re: simOMPL.createStateSpace()

The synopsis for the simOMPL.createStateSpace function is:

Code: Select all

int stateSpaceHandle=simOMPL.createStateSpace(
string name,
int type,
int objectHandle,
table boundsLow,
table boundsHigh,
int useForProjection,
float weight=1.0,
int refObjectHandle=-1
)
Where parameters mean:
name (string): a name for this state space
type (int): type of this state space component (see simOMPL.StateSpaceType)
objectHandle (int): the object handle (a joint object if type is simOMPL.StateSpaceType.joint_position, otherwise a shape)
boundsLow (table of float): lower bounds (if type is pose, specify only the 3 position components)
boundsHigh (table of float): upper bounds (if type is pose, specify only the 3 position components)
useForProjection (int): if true, this object position or joint value will be used for computing a default projection
weight (float, default: 1.0): (optional) the weight of this state space component, used for computing distance between states. Default value is 1.0
refObjectHandle (int, default: -1): (optional) an object handle relative to which reference frame position/orientations will be evaluated. Default value is -1, for the absolute reference frame
The parameter you are referring to (useForProjection) is a boolean.

I don't know where you find this usage where a value of 3 is passed to it, but it doesn't make sense.

Jas
Posts: 6
Joined: 11 Sep 2018, 08:20

### Re: simOMPL.createStateSpace()

Hi fferi
Thanks a lot for your reply. I have taken it from demo on motionPlanninDemo1.ttt

findPath=function(startConfig,goalConfigs,cnt)
-- Here we do path planning between the specified start and goal configurations. We run the search cnt times,
-- and return the shortest path, and its length