-
Notifications
You must be signed in to change notification settings - Fork 408
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
No effort feedback #146
Comments
Yes, this was never implemented. The reasoning for this is that the robot does not provide any effort information. The This being said, if you're only interested in getting the joint currents, this will be resolved in #35. If you would vote for having the joint currents in the |
@fmauch wrote:
well, there is Not sure whether we can get the same information into the RTDE output? |
Well, there is |
Hm. Could be worth a check with UR? Aren't there "free registers" available for syncing arbitrary data with RTDE? |
Definitely
Yes, we could certainly hack around this by wrapping the URScript into a general purpose register... |
@fmauch @gavanderhoorn Thanks for answering. My goal is to use effort feedback for object recognition as effort feedback would vary based in the object's weight. I've used real Baxter robot to do it and now I want to use UR5. I've not used the old UR5 driver, so I'm not sure that joint currents would be helpful or not. But, I'd prefer to use actual effort feedback because I'm working on a research project for my PhD. Based on your responses, I've following questions as I'm not familiar with robot drivers a lot:
Do you guys think getting effort feedback is possible in UR5? |
Any of the methods above yields some torque-related information (as the currents are also torque-reated), while the third option is probably closest to what you want to do, but it also seems to be the most hacky one. As @gavanderhoorn it might make more sense to talk to UR about this directly, first, which I will do soon. If you would like to implement one of the above, any contribution on this is welcome! |
I also want to access torque values. Unfortunately in #35 when adding the field target_moment i get the error: Edit: There is a typo in data_field_publisher.cpp (target_movement instead of target_moment) |
After talking back with UR, there is no equivalent to The hack with injecting script code that would send this back to ROS would indeed work (e.g. by writing them to a RTDE general purpose register). Another option is to take the @macsmitty Thanks for pointing out that typo. Could you please raise that on the actual PR itself? Unfortunately I haven't found the time to review this properly, yet. |
This would seem like the most straightforward way to achieve what we want, right? We just pretend there is actually such a field in RTDE, and parse the result as if it were there. If/when |
@fmauch As you mentioned that |
A very brief architecture overview is given at the driver's README page. When the driver and External Control are running, script code is being sent to the robot and executed there. For achieving the above, you would have to modify this script code such that it runs another thread that calls Then (in the same loop) you can write each field of that variable into individual RTDE fields using The code might look something like this (not tested, not complete): thread torqueThread():
while True:
torques = get_joint_torques()
write_output_float_register(24, torques[0])
write_output_float_register(25, torques[1])
write_output_float_register(26, torques[2])
write_output_float_register(27, torques[3])
write_output_float_register(28, torques[4])
write_output_float_register(29, torques[5])
end
# Don't forget to run the thread and also care about killing / joining it. the `while True` probably is not the best method doing this. This will populate the data to the RTDE fields You would have to add those to the output recipe and add handlers for that field to the As you can see, this involves a lot of changes to get from a new RTDE field to a ROS topic, which is the main purpose of #35. If you like to implement this behaviour, I will be happy to review this PR. |
@fmauch Thanks for your guidance. I learned about URScript and also tried to understand your solution. But, I still need help to solve the problem:
|
The other fields used are already inside the RTDE protocol which is why you can't find them in the script code. You can define the thread as mentioned above (similar to how the speed thread is defined) and then start the thread e.g. here by adding the line
Then, you'll have to also make sure to kill the thread at the end, e.g. after this line by adding the line
|
@fmauch I modified the script code as you suggested and ran The original script still works fine. Here's the modified script, it only has 150 lines. What could be wrong?
|
As I said, I didn't test the code, just wrote it by heart. This code seems to work:
|
As I didn't have the time to answer properly yesterday: The line number that came up in your error popup refers to the URScript generated by the program created on the robot. You can watch it by looking into the program folder on the robot. For your program In this case the error was referring to the last line, as I forgot to close the while loop with an Furthermore, the robot was complaining about index Anyway, that should cover the URScript part of your effort feedback. |
It would be great if the efforts of @gtatiya would result in a PR which contributes proper effort output on the |
…versalRobots#146 (comment). Got ERROR: Could not get fresh data package from robot
@fmauch, @gavanderhoorn Could we work on it here: #160 |
…versalRobots#146 (comment). Got ERROR: Could not get fresh data package from robot
@fmauch Does this issue address commanding efforts for full feedback control of the UR arms, or does it only apply to reading them? I've been digging pretty deep into URScript and RTDE documentation and can't seem to find a way to command torque at all. It seems like commanding torque (i.e., implementing a JointEffortInterface) is not possible? Or am I missing something? |
@Scott-Merritt: no, this PR will not let you command joint torques.
No. Afaik, there is no publicly available interface which allows you to command joint torques for URs. |
This issue is solved in commit b46651. Thanks! |
Are you aware of a private interface that does so? Are you aware of UR providing access to such an interface to their partners? I'm trying to gauge whether it would be a worthwhile use of time to work my way up through the sales channels, or if that's ultimately going to be a dead end. |
Summary
Hi, I'm trying to get effort feedback from the UR5 robot, but I'm not getting it. I'm running this commands:
Terminal 1:
roslaunch ur_robot_driver ur5_bringup.launch robot_ip:=172.22.22.2 kinematics_config:="$(rospack find bimur_ur_launch)/etc/bimur_right_arm_calibration.yaml"
Terminal 2:
rostopic echo /joint_states
Actual Behavior
Here's the output:
As you can see effort values are zeros. It's zero even if I move the arm.
I followed the instructions provided to set the driver up and it works as I'm able to control the arm using
rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller
.I was getting effort values using the old driver which is deprecated: https://github.com/ros-industrial/ur_modern_driver.git.
Expected Behavior
Here's the output of
rostopic echo /joint_states
for old driver:How can get the effort feedback?
Versions
The text was updated successfully, but these errors were encountered: