-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverse mtsPID: smoother velocities when in simulation mode #3
base: devel
Are you sure you want to change the base?
Conversation
commit e0aab8f introduced a bug that makes joint velocities are not zero even when joints are stationary. To reproduce the issue 1. run dVRK console with a MTMR configuration file 2. press "home" button on dVRK console 3. rostopic pub /dvrk/MTMR/set_position_goal_cartesian geometry_msgs/Pose "position: x: -0.02814 y: -0.06600 z: 0.40150 orientation: x: 0.5 y: 0.5 z: 0.5 w: -0.5" -1 4. press "power off" button on dVRK console 5. press "home" button on dVRK console 6. you can see some joint efforts are not zeros because some joint velocities are not zeros
@vincent-hui , can you confirm that this is in KIN simulated mode? When using a real robot all velocities are estimated on the FPGA and the PID component should not modify these. To be honest, in kinematic simulated mode, since the robot moves instantly to the desired position, efforts don't really mean anything. |
To note, I pushed some changes on the devel branch to provide a slightly better velocity estimation using the setpoint/commands sent to the PID in kinematic simulation mode. See 8cd3530 |
At line#892 of mtsPID.cpp
In sequence of "home" -> move joint by /dvrk/MTMR/set_position_goal_joint -> "power off" -> "home".
|
Hi Vincent, I'm trying to understand the ultimate goal for the "kinematic" simulation mode. My intentions are:
Can you provide an example of use for the velocities and efforts in simulation mode? I get the feeling that maybe the solution is to keep the PID component as is but create a different IO component (e.g. for dynamic simulation) that will receive the desired efforts and provide a simulated measured position/velocity/effort. |
Thank you for the clarification, I didn't see any value using the
In both cases, I assume we should set the measured joint state based on the desired one. Does this make sense? If we agree, I'll rewrite the code using two |
The specs you wrote is very similar to what I think. In position mode In effort mode I propose two changes.
You can decide how to implement these changes. |
I've been looking into different ways to get a reasonable velocity estimation when in simulation mode and I think the best way is to use the data sent by the "user", i.e. the arm class. When nothing is sent for a bit (20 ms), velocity goes back to zero. I also patched the code to have zero velocity if effort mode is used. @vincent-hui , can you test cdd8be4? Unfortunately, this also requires the latest sawIntuitiveResearchKit devel branch. |
Thank you for your patch, I tested cdd8be4 . It works well. |
commit aeb68cf introduced a bug that makes joint velocities be not zero even when joints are stationary.
To reproduce the issue
rostopic pub /dvrk/MTMR/set_position_goal_cartesian geometry_msgs/Pose "position:
x: -0.02814
y: -0.06600
z: 0.40150
orientation:
x: 0.5
y: 0.5
z: 0.5
w: -0.5" -1
4. press "power off" button on dVRK console
5. press "home" button on dVRK console
6. you can see some joint efforts are not zeros because some joint velocities are not zeros.