Issues with jacobi-motion-0.0.33

🧐 Under review

I am facing different issues with the latest release of the jacobi Python library. Here are the two that I could notice so far:

  1. It seems like the

    Robot.set_base()

    method vanished, and I didn't find any new equivalent.
    import jacobi
    r = jacobi.robots.UniversalUR10()
    r.set_base(jacobi.Frame(x=1))

    gives the error
    AttributeError: 'jacobi.robots.UniversalUR10' object has no attribute 'set_base'

  2. The planner seems to sometimes output trajectories with duplicate points. For example:

    ...
    ---------------------------------------
    delta_time: 0.56
    [
      pos:[0.3645631903549399, -1.3499699545987047, 1.9407129751035896, -2.1932749051672698, -1.5749572201786464, -1.2576011030217746],
    ]
    ---------------------------------------
    delta_time: 0.56
    [
      pos:[0.3645631903549399, -1.3499699545987047, 1.9407129751035896, -2.1932749051672698, -1.5749572201786464, -1.2576011030217746],
    ]
    ---------------------------------------
    ...

The only solution I found was to rollback to v0.032.

Alban Laflaquiere

1 month ago

Activity
Jonathan Tai

Thanks for lettgin us know!
as for 1. Let me ask our engineering team to see if they have any insight on this.

as for 2. I'm having the team take a quick look at the planner. In the meantinme would you be able to provide a little bit more context as to how you got the output trajectories with duplicate points? Does it happen on any trajectory generation? Which robots are you working with? (and would you be able to share some more details around the project you are seeing this with?)

0    1 month ago    Reply

Comment must be at least 20 characters.
Cancel

We appreciate your feedback.

Alban Laflaquiere

Unfortunately, I don't have much info. I can try to get back to you later (but I'll be on vacation very soon.)
From what I remember, I'm 95% sure it was a linear motion though, and that the amplitude of the motion itself was quite small (a few centimeters).
Hopefully, that helps a bit.

0    1 month ago    Reply

Comment must be at least 20 characters.
Cancel

We appreciate your feedback.

Alban Laflaquiere

Some more details after I was able to reproduce the problem in a minimal script (see below):

  • It happens only with LinearMotion
  • Surprisingly, it seems to happen only for very specific timestep sizes:
    timestep: 0.005 - duplicate delta time: 0.555
    timestep: 0.01 - duplicate delta time: 0.56
    timestep: 0.02 - duplicate delta time: 0.56
    timestep: 0.023 - duplicate delta time: 0.552
    timestep: 0.031 - duplicate delta time: 0.558
    timestep: 0.04 - duplicate delta time: 0.56
    timestep: 0.041 - duplicate delta time: 0.5740000000000001
    timestep: 0.042 - duplicate delta time: 0.5880000000000001
    timestep: 0.046 - duplicate delta time: 0.552
    timestep: 0.047 - duplicate delta time: 0.5640000000000001
    timestep: 0.048 - duplicate delta time: 0.5760000000000001
    timestep: 0.049 - duplicate delta time: 0.5880000000000001
    timestep: 0.05 - duplicate delta time: 0.6000000000000001
    timestep: 0.062 - duplicate delta time: 0.558
    timestep: 0.079 - duplicate delta time: 0.553
    timestep: 0.08 - duplicate delta time: 0.56
    timestep: 0.081 - duplicate delta time: 0.5670000000000001
    timestep: 0.082 - duplicate delta time: 0.5740000000000001
    timestep: 0.083 - duplicate delta time: 0.5810000000000001
    timestep: 0.084 - duplicate delta time: 0.5880000000000001
    timestep: 0.085 - duplicate delta time: 0.5950000000000001
    timestep: 0.08600000000000001 - duplicate delta time: 0.6020000000000001
    timestep: 0.08700000000000001 - duplicate delta time: 0.6090000000000001
    timestep: 0.092 - duplicate delta time: 0.552
    timestep: 0.093 - duplicate delta time: 0.558
    timestep: 0.094 - duplicate delta time: 0.5640000000000001
    timestep: 0.095 - duplicate delta time: 0.5700000000000001
    timestep: 0.096 - duplicate delta time: 0.5760000000000001
    timestep: 0.097 - duplicate delta time: 0.5820000000000001
    timestep: 0.098 - duplicate delta time: 0.5880000000000001
    timestep: 0.099 - duplicate delta time: 0.5940000000000001
  • I haven't seen more than 1 duplicate in the trajectory I chose
  • This happens both with cloud and on-prem version of the lib (v0.0.32)

import jacobi

robot = jacobi.robots.UniversalUR5e()

joint_names = [
    "shoulder_pan_joint",
    "shoulder_lift_joint",
    "elbow_joint",
    "wrist_1_joint",
    "wrist_2_joint",
    "wrist_3_joint",
]

robot.set_base(jacobi.Frame.from_quaternion(x=-0.1, y=0.0, z=0.778, qx=0.0, qy=0.0, qz=0.0, qw=1.0))
robot.flange_to_tcp = jacobi.Frame.from_quaternion(
    x=-4.0155031343329083e-13,
    y=-0.08200070709142922,
    z=0.20374969879588292,
    qx=-4.496334640197861e-18,
    qy=-1.836602551794397e-06,
    qz=0.9999999999983135,
    qw=2.448180546764611e-12,
)

robot.max_velocity = [0.1 * v for v in robot.max_velocity]
robot.max_acceleration = [0.1 * v for v in robot.max_acceleration]

start = jacobi.Waypoint(
    position=[
        -0.2274138063906141,
        -1.224123650017857,
        1.9087685108689072,
        -2.254713396909295,
        -1.5737379891516146,
        -4.094896483092814,
    ]
)
goal = jacobi.CartesianWaypoint(
    jacobi.Frame.from_quaternion(
        x=0.4017176276920228,
        y=-0.048692228485077385,
        z=0.8390208291756214,
        qx=0.9131367110202927,
        qy=-0.40764452677770674,
        qz=8.542422724806657e-05,
        qw=0.0026980507637731866,
    )
)

scene = jacobi.Environment(robot=robot, safety_margin=0.0)

jacobi_planner = jacobi.Planner(scene, delta_time=0.02)

desired_motion = jacobi.LinearMotion("my_motion", robot, start=start, goal=goal)

trajectory = jacobi_planner.plan(desired_motion)

for t, p in zip(trajectory.times, trajectory.positions):
    print(t, p)

for dt1, dt2 in zip(trajectory.times[:-1], trajectory.times[1:]):
    if dt1 == dt2:
        print("duplicate delta time:", dt1)

0    1 month ago    Reply

Comment must be at least 20 characters.
Cancel

We appreciate your feedback.

Jonathan Tai

@Alban Laflaquiere:

Fantastic! Thanks for all this information!

  1. Looks like we failed to update the documentation with regards to the changes on that function. Sorry about that!

    set_base

    has been changed to

    base

    as a property, and would need to be changed as such in the code.

As for 2.

Looks like that indeed is a bug! Seems that we have tuned one of our internal parameters a bit too much which is causing some joint positions to duplicate due to generated waypoints being too close together. As I understand this shouldn't effect normal operation, and we will have a fix for it in next patch!

0    1 month ago    Reply

Comment must be at least 20 characters.
Cancel

We appreciate your feedback.

Jonathan Tai

@Alban Laflaquiere: with regards to the

set_base

to

base

change. Here is the updated documentation that reflects that change. Let me know if that helps move you to the next version!

0    1 month ago    Reply

Comment must be at least 20 characters.
Cancel

We appreciate your feedback.

No votes yet