HELLO,
How to display the trajectory curve of the end-effector of manipulator in the latest version of the software (V4.2) ?
How to show the trajectory curve of the end-effector of manipulator?
How to show the trajectory curve of the end-effector of manipulator?
Last edited by zhangm365 on 14 Jan 2022, 10:09, edited 1 time in total.
Re: How to show the trajectory curve of the end-effector of manipulator?
Hello,
the easiest would be to add a dummy to your scene, attach it to the end-effector, then attach following child script to the dummy:
Cheers
the easiest would be to add a dummy to your scene, attach it to the end-effector, then attach following child script to the dummy:
Code: Select all
function sysCall_init()
h=sim.getObjectHandle(sim.handle_self)
dr=sim.addDrawingObject(sim.drawing_lines|sim.drawing_cyclic,2,0,-1,500,{1,0,1})
pt=sim.getObjectPosition(h,-1)
end
function sysCall_sensing()
local l={pt[1],pt[2],pt[3]}
pt=sim.getObjectPosition(h,-1)
l[4]=pt[1]
l[5]=pt[2]
l[6]=pt[3]
sim.addDrawingObjectItem(dr,l)
end
Re: How to show the trajectory curve of the end-effector of manipulator?
Thank your prompt reply.
Why does the displayed trajectory disappear automatically?
Can it be retained?
Why does the displayed trajectory disappear automatically?
Can it be retained?
Re: How to show the trajectory curve of the end-effector of manipulator?
Yes you can increase drawing object maxItemCount, which is the 5th argument of sim.addDrawingObject, and you can explicitly clear the drawing object with
sim.addDrawingObjectItem(dr,nil)
Re: How to show the trajectory curve of the end-effector of manipulator?
ok, thanks your reply.
As scripts pointed out int the figure:
https://vrep.oss-cn-shenzhen.aliyuncs.c ... RjNjk4N2Fi
Can the variables between two child scripts, as the picture showed, identify each other?
As scripts pointed out int the figure:
https://vrep.oss-cn-shenzhen.aliyuncs.c ... RjNjk4N2Fi
Can the variables between two child scripts, as the picture showed, identify each other?
Re: How to show the trajectory curve of the end-effector of manipulator?
Yes. One way is to use signals.
You can set a signal in one script, and read the signal with the same name in the other script.
Related API functions:
You can set a signal in one script, and read the signal with the same name in the other script.
Related API functions:
- sim.setIntegerSignal / sim.getIntegerSignal / sim.clearIntegerSignal
- sim.setFloatSignal / sim.getFloatSignal / sim.clearFloatSignal
- sim.setDoubleSignal / sim.getDoubleSignal / sim.clearDoubleSignal
- sim.setStringSignal / sim.getStringSignal / sim.clearStringSignal
- sim.getSignalName
- sim.waitForSignal