move irb140 in real time via joystick
Comments
-
Could you provide a snippet? I'm guessing you don't supply the correct values. Like mm to m conversion, or in the case of angles, euler to quaternions. Have you tried the GetJointValues before to see that they match?
Now why would you want to jog the mechanism like this? Its just the simulation mechanism in RobotStudio, and for that you have better tools available like the "Mechanism Joint Jog" dialog in RobotStudio. Or the freehand "Jog Linear". Is it for school?
John
Developer Center0 -
Yes it's a school project but the code is eventually suposed to work with a real robot in smaller scale. If I understand you right solving it this way wont work whith a real robot? In that case are there any other way to solve it?Now i'm just trying to make the robot to move without joystick just by assign a small shift in one of the joints. Here is the code for that:Shared Function myFunction()jointVal(2) = jointVal(2) + 0.1mech.SetJointValues(jointVal, False)station.UpdateGraphics(True)Exit FunctionEnd FunctionShared Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs)myFunction()End SubWhere "OnTimedEvent" is called 2 times every second. It works if i call the "myFunction()" from "Shared Sub AddinMain()" but not if i call it from "OnTimedEvent".0
-
Using Mechanism.SetJointValues would be the equivalent to going to the robot and physically pushing the arm to get it to move. You are not creating any motion initiated by the controller. So that will not work at all on a real controller+robot.
The RobotStudio SDK handles everything in the RobotStudio GUI domain. That means that it doesn't handle the controller.
To be able to get the controller to move the manipulator you need to use the PC SDK. That gives you the ability to actually control a robot.
http://developercenter.robotstudio.com/DevCenter.aspx?DevCenter=RobotCommunication
If it works when coming from a menu/button call but doesn't when coming from the OnTimedEvent then I think you have a classic GUI threading issue. You should solve that with an invoke delegate solution.
http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx
Now in this forum we have had a couple of these types of app questions. So you should be able to get some basics by searching. Like this one which will give some hints to where you should be heading:
http://forums.robotstudio.com/discussion/comment/20748
Maybe you/your teacher might be interested in this? (Joysticks are so old school
http://mdh.diva-portal.org/smash/record.jsf?pid=diva2:279305&rvn=1
John
Developer Center0 -
Thanks for the reply.Tried the invoke delegate but didn't really work, I can use "getjointvalues()" in the onTimedEvent sub but not "setjointvalues()" in onTimedEvent. Are there any other way just to control the robot in robotstudio (it doesn't have to work with a real robot)? Like the way you can controll the robot with the joystick in the virtual flexpendant?0
-
Or could i get some help vi the invoke delegate solution, i'm brand new with VS and visual basic.0
-
I would be very grateful if there Isithere anyone who has an example code on howe to solve this with an invoke deligate solution.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings