Inquiry for follow-path code
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Inquiry for follow-path code
Predefined Movement Sequence?
Does this essentially mean that every joint on the legs has a path and is enabled with Inverse-Kinematics in order to assure that the robot model has the best balance everytime? Or is it using more of position control?
Thanks
Does this essentially mean that every joint on the legs has a path and is enabled with Inverse-Kinematics in order to assure that the robot model has the best balance everytime? Or is it using more of position control?
Thanks
Re: Inquiry for follow-path code
The relative foot motion is defined for each foot, i.e. each foot has a list of pos-time pairs. Then, ik is applied to compute for a given pair the corresponding joint angles. Those joint angles are then applied to the leg joints, which all operate in position control mode.
Cheers
Cheers
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Inquiry for follow-path code
What would be an example of a position-time pair? This is a term that relatively new for me.
Thanks.
Thanks.
Re: Inquiry for follow-path code
That's entirely up to you, e.g.:
t=0.00 , p={0,0,0}
t=0.05, p={0,0,0.1}
t=0.10, p={0,0,0.2}
etc.
and you can keep that in code like:
Cheers
t=0.00 , p={0,0,0}
t=0.05, p={0,0,0.1}
t=0.10, p={0,0,0.2}
etc.
and you can keep that in code like:
Code: Select all
positions={{0,0,0},{0,0,0.1},{0,0,0.2}}
times={0,0.05,0.1}
or
data={{0,{0,0,0}},{0.05,{0,0,0.1}},{0.1,{0,0,0.2}}}
or
...
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Inquiry for follow-path code
Is there a sensor or any way on Coppeliasim to detect how tilted a shape is? - A way to read what its orientation with respect to an axis in the world is or something and then a way to print the angle in order to use it in code?
Thank you in advanced...
Thank you in advanced...
Re: Inquiry for follow-path code
Yes, you can use e.g. sim.getObjectOrientation or sim.getObjectMatrix
sim.getObjectOrientation returns Euler angles of the reference frame of the object, relative to the world (if the second argument is -1 or sim.handle_world), or relative to another reference frame.
sim.getObjectMatrix can also be used, knowing that:
With above vectors, you can do many types of calculations, also orientation-related.
Cheers
sim.getObjectOrientation returns Euler angles of the reference frame of the object, relative to the world (if the second argument is -1 or sim.handle_world), or relative to another reference frame.
sim.getObjectMatrix can also be used, knowing that:
Code: Select all
local m=sim.getObjectMatrix(objectHandle,-1)
unitAxisX={m[1],m[5],m[9]}
unitAxisY={m[2],m[6],m[10]}
unitAxisZ={m[3],m[7],m[11]}
Cheers
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Inquiry for follow-path code
May I know what are the values that sim.getObjectOrientation returns please? And what they mean?
Thanks in advance.
Thanks in advance.
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Inquiry for follow-path code
Would there be a way to execute sim.getObjectOrientation repeatedly during a simulation - like obtaining the alpha, beta and gamma of an selected object every instant or every so often during?
Thanks in advance for the advice.
Thanks in advance for the advice.
Re: Inquiry for follow-path code
Code: Select all
function sysCall_init()
objectHandle=sim.getObject('.')
end
function sysCall_sensing()
print(sim.getObjectOrientation(objectHandle,-1))
end