Motion Properties of Paths in latest version

Typically: "How do I... ", "How can I... " questions
Post Reply
drmajr
Posts: 4
Joined: 11 Sep 2015, 11:32

Motion Properties of Paths in latest version

Post by drmajr » 11 Sep 2015, 11:46

The previous version of vrep (v 3.2.1) had the ability to edit the motion properties of paths via the scene object properties dialog box. This seems to have be moved/removed in the latest version (v 3.2.2 ). Where can I modify the motion properties of paths in the latest version, things like target nominal velocity, max acceleration, angular to linear conversion coefficient, etc.?

Thanks.

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

Re: Motion Properties of Paths in latest version

Post by coppelia » 11 Sep 2015, 15:19

Hello,

this has been removed, since the same functionality (with even more flexibility) can be achieved via child scripts.
Take the following model as an example how to do this: Models/equipment/conveyorBelts/conveyor belt.ttm: in the attached child script, you basically manually update the intrinsic position of the path with simSetPathPosition.

If you use a threaded child script, then you can achive a very specific movement profile with following example:

Code: Select all

moveToPosition=function(_pathHandle,startPos,endPos,maxVel,maxAccel,maxJerk)
	local posVelAccel={startPos,0,0}
	local targetPosVel={endPos,0}
	local maxVelAccelJerk={maxVel,maxAccel,maxJerk}
	local rmlHandle=simRMLPos(1,0.0001,-1,posVelAccel,maxVelAccelJerk,{1},targetPosVel)
	local newPosVelAccel=posVelAccel
	while true do
		local result,newPosVelAccel=simRMLStep(rmlHandle,simGetSimulationTimeStep())
		simSetPathPosition(_pathHandle,newPosVelAccel[1]) -- update the path's intrinsic position
		if result~=0 then
			break
		end
		simSwitchThread()
	end
	simRMLRemove(rmlHandle)
end

pathHandle=simGetObjectHandle("ConveyorBeltPath")
simSetPathTargetNominalVelocity(pathHandle,0) -- for backward compatibility

moveToPosition(pathHandle,0,2,0.1,0.01,0.01)
moveToPosition(pathHandle,2,0,0.1,0.01,0.01)
Cheers

drmajr
Posts: 4
Joined: 11 Sep 2015, 11:32

Re: Motion Properties of Paths in latest version

Post by drmajr » 11 Sep 2015, 22:03

coppelia wrote:Hello,

this has been removed, since the same functionality (with even more flexibility) can be achieved via child scripts.
Take the following model as an example how to do this: Models/equipment/conveyorBelts/conveyor belt.ttm: in the attached child script, you basically manually update the intrinsic position of the path with simSetPathPosition.

If you use a threaded child script, then you can achive a very specific movement profile with following example:

Code: Select all

moveToPosition=function(_pathHandle,startPos,endPos,maxVel,maxAccel,maxJerk)
	local posVelAccel={startPos,0,0}
	local targetPosVel={endPos,0}
	local maxVelAccelJerk={maxVel,maxAccel,maxJerk}
	local rmlHandle=simRMLPos(1,0.0001,-1,posVelAccel,maxVelAccelJerk,{1},targetPosVel)
	local newPosVelAccel=posVelAccel
	while true do
		local result,newPosVelAccel=simRMLStep(rmlHandle,simGetSimulationTimeStep())
		simSetPathPosition(_pathHandle,newPosVelAccel[1]) -- update the path's intrinsic position
		if result~=0 then
			break
		end
		simSwitchThread()
	end
	simRMLRemove(rmlHandle)
end

pathHandle=simGetObjectHandle("ConveyorBeltPath")
simSetPathTargetNominalVelocity(pathHandle,0) -- for backward compatibility

moveToPosition(pathHandle,0,2,0.1,0.01,0.01)
moveToPosition(pathHandle,2,0,0.1,0.01,0.01)
Cheers
Thanks! It's funny though, because scene's that have the old path objects still work in the new version. It's just that you can't modify the motion properties.

Cheers!

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

Re: Motion Properties of Paths in latest version

Post by coppelia » 14 Sep 2015, 09:00

Yes, the functionality is still present in order not to beak-down compatibility with existing scenes/models, but not accessible anymore.
Too many people where confused to see objects follow a path (or joints perform a predefined movement) without having a child script in the scene.

Cheers

Post Reply