-
Notifications
You must be signed in to change notification settings - Fork 340
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
The URScript topic #162
Comments
Sending a msg to the You'll probably have to put all statements in a single program and send that in one message. Question: can you use
this is not really ROS-related: try sending the same script lines using |
@gavanderhoorn I think sending the whole program at once could work here. But I have a related question that what if I do have to send the program line by line in order to be able to stop sending the script under certain conditions? I happen to be implementing an action that can do exactly this where I hope to give users the freedom to cancel the script at any moment. But it seems to me that when using the URScript topic, you never know the when the command you send will be finished because there is no feedback. So you have no idea if it is a good timing to insert a stopj command. If this is a service that can return true when the script is finished, there should not be any problem sending it line by line. |
Hi @tiangxiang84, just saw your post on dof and here as well. Yes, you need to send a string containing all your script at once. If you use @hansondon You can always set/unset IOs on the robot via the script you send, which are already exposed by the driver, so you can sync/communicate to the ROS side that your script did something or not |
@carlosjoserg Ah! That's a good workaround. I'll need to set/unset IOs before and after every actual command, though. But it solves my problem. Thanks! |
There's no way to detect whether "the script" has finished. That is a limitation of the infrastructure provided by UR, not of the driver btw. |
Thanks everyone for the response. It is helpful. So I tried to put these lines in a talker.cpp: /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////// On the console, I received: On another terminal where I used rostopic echo ur_driver/URScript, I received: sdrwcs@ia3:~$ rostopic echo ur_driver/URScript
|
I can now make it work by directly communicating between my PC and robot without using the ur_driver/URScript topic. The commands I sent to the UR are: Thanks everyone for the help. But the issue of using URScript topic is still there (my previous posts). I still cannot make it work using the ROS topic. If anyone knows where I did wrong, please let me know. I am curious. Tianxiang |
Not a very qualified comment because I haven't used URScript a lot, but I know that I sent this example program to the /robot_name/URScript topic successfully. Note the wrapping function definition, which might be required:
|
Hi, @tianxiang84 I saw your post a few days ago and based on your comments and @carlosjoserg 's suggestions, I developed this C++ class to control the Robotiq's 85 Gripper through UR3 controller using URScript ROS topic. I 've tested it in a sample node and the gripper moves and works fine... You can find the source code/package here. Notice that the robotiq URcap must be installed in the controller and that @felixvd comment is valid, it is required to use the def/end statement (Almost every time). I'm not expert neither in ROS nor C++ so if anyone has any suggestion/recommendation please let me know. |
@ctaipuj can you provide the link to your program again? Now it's 404 :) |
This is a popular google result, so in case someone can use it, I'll just link this header file that waits for the UR controller to complete a program. It will work as soon as #247 is merged. As it says, the ur_modern_driver script does not stop, so can only check if your own URScripts that you sent to the urscript topic have completed, but it might be useful for someone. |
@ctaipuj could you give a valid link please~~~ the old is dead. Thanks (: |
Hello @Giessen @DavidYaonanZhu, sorry for the delayed response. I just fixed the link to the repo. Sorry but currently this package doesn't have a readme file. Please check the doc directory where you can find the class documentation. |
Seeing as this issue has gone somewhat off-topic (from "how to use urscript topic" to "how to control robotiq grippers") I'm closing this. |
Hi Thomas and all,
I am trying to use the URScript topic to control a Robotiq gripper, but somehow cannot make it work. If anyone has suggestion, please kindly let me know.
The following script works on the UR teach pad, when it is run, the gripper can be activated and then close as expected.
Then I was trying to publish these line by line to the ur_driver/URScript topic. The gripper does not do anything.... I tried to publish a simple "power off" to the topic, and it works, the power is turned off, so seems to me topic is good.
I checked the log on the teach pad, whenever I send the "socket..." message, there is a "Program socket_set_var started", immediately followed by a "Program socket_set_var stopped". So I guess it is the timing issue? In order for it to work, it should not stop so quickly?
I am fairly new to ROS, so I could be doing something totally wrong, if anyone has any idea, please let me know.
Thanks.
Tianxiang
The text was updated successfully, but these errors were encountered: