How to get trajectory and torques from simulation to control the real robot?
Posted: 10 Sep 2020, 09:59
Hi,
I am trying to control a real robot with a controller that uses as an input: positions, velocities, accelerations and torques for a given trajectory.
I would like to get all of these values from simulation.
I can get positions, velocities and accelerations from sim.rmlPos and then during sim.rmlStep move robot in simulation with sim.setJointTargetPosition and then read torques of each joints. In this approach I obtain torques that are a little shifted in time. Is there a way to synchronize it?
I also tried to use sim.rmlMoveToJointPosition, where I can read joints' torques during moving, but I do not know how to get joint positions, velocities and accelerations. Is there a way to obtain them during simulation?
E.g. for velocity I see there is sim.getObjectVelocity method but obtained values are in absolute coordinates. I wonder if there is a simpler way to get the speed.
I have one more question. Torques from simulation are not so adequate to the real ones, i.e. implementing them to robot do not gives proper move. I change frictions and add angular and linear damping, but these damping parameters seems to have no affect if there are fractional values, only change from 0 to 1 change the torques values. Is it right?
So, is there a way to get positions, velocities, accelerations and torques simultaneously from a simulation?
Thanks.
I am trying to control a real robot with a controller that uses as an input: positions, velocities, accelerations and torques for a given trajectory.
I would like to get all of these values from simulation.
I can get positions, velocities and accelerations from sim.rmlPos and then during sim.rmlStep move robot in simulation with sim.setJointTargetPosition and then read torques of each joints. In this approach I obtain torques that are a little shifted in time. Is there a way to synchronize it?
I also tried to use sim.rmlMoveToJointPosition, where I can read joints' torques during moving, but I do not know how to get joint positions, velocities and accelerations. Is there a way to obtain them during simulation?
E.g. for velocity I see there is sim.getObjectVelocity method but obtained values are in absolute coordinates. I wonder if there is a simpler way to get the speed.
I have one more question. Torques from simulation are not so adequate to the real ones, i.e. implementing them to robot do not gives proper move. I change frictions and add angular and linear damping, but these damping parameters seems to have no affect if there are fractional values, only change from 0 to 1 change the torques values. Is it right?
So, is there a way to get positions, velocities, accelerations and torques simultaneously from a simulation?
Thanks.