I have found a workaround for my problem, but would still like to understand the proper way of doing it.
Here’s some more details:
I have setup a Conv
feature touching two screw points on my conveyor’s chassis. And set up conveyor tracking using it works fine if I am using the Conveyor Tracking
wizard.
However if I am trying to use the same feature to track a conveyor from urscripts:
track_conveyor_linear(Conv, 2500000, 0)
This results in tracking to a completely wrong direction.
For debugging I created a Conveyor Tracking
wizard node, and checked the .script file to see how it works under the hood. It actually subtracts the two point features instead of using the line feature:
track_conveyor_linear(
pose_sub(
p[0.17618015612116103,
0.2888867189387522,
0.0041121763977068765,
2.6904154016660575,
-1.4021931995541972,
0.004540402182327259],
p[-0.4808430140572028,
0.31506190698267633,
0.009952606914532765,
2.8725817683539336,
1.2526583452730924,
-0.06348787362283329]
),
2500000, 0
)
Except that these points are not set as feature, so there is no easy access to them.
Now on the URCaps side, I can access the Line Feature using: element.getPose().toString()
which gives me the same problem as using track_conveyor_linear(Conv, 2500000, 0)
.
What I did to overcome this was to use the deprecated functions:
GetPoint1()
GetPoint2()
and subtract them.
This works, but since these are deprecated, I don’t believe I am supposed to use them. And I dont know if there is any guarantee they would stay in the API.