Linear rail with Python


#1

Hey there, I am currently trying to use the linear rail hooked up to my Dobot Magician with Python (written in Pycharm)
In my image I have posted some of my code, where I have some move functions and suctioncub functions that all work fine. Except outside the blue mark is the supposed linear rail code that should move the robot to position 400 on the rail, but not happens.
The blockly code given for the same function can’t really be copied over so is hardly a help. If anyone has any advice on how to make the linear rail work please let me know.

image


#2

Hey there, I am still looking for help with this issue.

I have a feeling that is has something to do with:
dType.SetDeviceWithL(api, isWithL, version)
but no matter what I write I get an error when executing the code. What is supposed to be at “version”?

the blockly script help is very vague and doesn’t help at all.


#3

Hi Alex,

i haven’t worked with this. The only thing i see is that there to less parameters. Check the function in blocky code. There is the (api-Parameter, the 1 (type of movement i thing), x, y, z, r, rail-position(?), isQueued). You only have the (api, type of movement, x,y,z,r,rail position).
This could be a possible failure.


#4

Hey Chris, I just now fixed the issue, you don’t actually need dType.SetDeviceWithL(api, isWithL, version) at all.

I think the issue was that I didn’t use current_pose


simply using this code made it work, although I am pretty sure I tried it once, but atleast it works now


#5

Actually nevermind, it only seems to work sometimes, and I cannot quite figure out why

Sometimes I get this error “Dobot is not in L model”