for i in range(htm.shape - 1):
targetname = 'Target %i' % (i + 1)
target = RDK.AddTarget(targetname, reference, robot)
I get a error : AttributeError: 'numpy.ndarray' object has no attribute 'isHomogeneous'
I overcome this by remplacing htm[i] by KUKA_2_Pose(Pose_2_KUKA(htm[i+1])). But it doesn`t seems to be the proper way.
When running the corrected program, i get an error that the target is out of reach. as shown in the picture enclosed.
Do you have an idea of where it can come from ?
I tried another solution. Indeed, I added the following :
The rail finally move to reach the target but it doens't reach the proper target.
09-13-2019, 04:11 PM (This post was last modified: 09-13-2019, 04:16 PM by MarcGondran.)
Thank you for your answer.
Unfortunately, it doesn't solve the "target out of reach" issue. What about it ?
I should precise that I acheive placing the targets. It just says that they are out of reach while obviously they are not.
12-02-2019, 07:24 PM (This post was last modified: 12-02-2019, 07:40 PM by MarcGondran.)
I will reply to this subject again.
Indeed I did kind of solve the issue using the previous code however. I have a lot of point and it takes very long to generate using this mean. I use the MacOS version of RoboDK and the straight forward method to create target using the API works. However when back to the windows version, it still doesn't work.
The straight forward code I use is this one :
RDK = Robolink()
robot = RDK.Item('KUKA KR 100 HA', ITEM_TYPE_ROBOT)
if not robot.Valid():
raise Exception('No robot selected or available')
When you use external axes you need to at provide the position of the external axes in your target (using setJoints). If the target is Cartesian you don't need to worry about the robot axes. Alternatively, you can load a robot machining file such as Gcode or APT and use a curve follow project or robot machining project. You'll then be able to optimization tools for external axes.
I was unable to test your file as it requires additional input data but this small script will allow you to update the position of the external axes to all targets in a station (for example, 5000 mm):
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
targets = RDK.ItemList(ITEM_TYPE_TARGET)
for t in targets:
# Set the value of the external axis
e1 = 5000 # in mm
# Recalculate the joint position based on the new position of the external axis
# Robot joints are updated but not external axis
If you are looking for faster speed (I noticed you already disabled Render) I would recommend you to use the C++ API (slightly faster) or the plugin interface to create a plugin (much faster). The API's are almost the same in both cases.
12-03-2019, 04:14 PM (This post was last modified: 12-03-2019, 05:07 PM by MarcGondran.)
Thank you for your answer Albert. Actually, I don't know the external rail position, I want robodk to optimize this parameter. How can I manage it ?
Plus what's weird is that it totally works on MacOS this way.
# Test the program and make sure it is 100% feasible
valid_ins, prog_time, prog_len, valid_ratio, error_msg = program.Update()
if valid_ratio < 1.0:
print(" Unable to complete the program")
print(" " + error_msg)
print(" Program feasible!")
# stop looking