Lula trajectory generation with Kuka kr210

Isaac Sim Version

4.5.0
4.2.0
4.1.0
4.0.0
4.5.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):

Operating System

Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):

GPU Information

  • Model: RTX 2080
  • Driver Version: Studio Driver - 572.16

Topic Description

I am trying to use the Lula Trajectory generation example but instead of a UR10, I am using a Kuka KR210. So far, I have only changed the paths for the urdf and the rmpflow config files. The compute_task_space_trajectory_from_points returns None. My targets look like this:

task_space_position_targets = np.array([
            [1.0, -1.0, 1.0],
            [-1.0, -1.0, 1.0],
            [-1.0, 1.0, 1.0],
        ])

The Trajectory generator fails to compute a valid trajectory. With UR10, the trajectory is correctly computed with the same coordinates, but not with Kuka Kr210.

Screenshots or Videos

immagine

Additional Information

I tried to change the coordinates, the acceleration and jerk limits from the robot description, but it did not have any effect

It looks like your GPU doesn’t satisfy the minimum requirements for Isaac Sim Isaac Sim Requirements — Isaac Sim 4.2.0 (OLD)

The warning in your screenshot is hard to read. What does it say?

Hello! I think the GPU might not be the problem since I can do trajectory generation for UR10 without any problems. But to be sure, I have also tried the example with a RTX 4090 and I have the same problem with the KR210.

The warning says that “Unable to kind IK solution for domain value[0], which corresponds to a pose with position (1,-1,1) and orientation ([x,y,z],w):([0,1,0],0). The last waypoint conversion was at domain value [6.95332e-310], where the domain bounds for the task space path are [0,4]”
“Conversion from ‘TaskSpacePathSpec’ to ‘LinearCSpacePath’ failed”
“Trajectory: None”

It fails to compute a trajectory between the given points.

Thanks @saa-97! Have you checked out the debug features tutorial Lula RMPflow — Isaac Sim 4.2.0 (OLD) ?
According to the warnings, it looks like some waypoints are not reachable.

Also it would be helpful if you can share your script so I can try to replicate the issue.

I had the same problem and managed to reach all three points by modifying the KUKA’s .urdf file, allowing the revolute joint between the base and link1 to rotate within these limits: lower=“-6.283” upper=“6.283”
I’m not sure if this is the correct way to solve the problem. Below, I paste my scenario.py.

import numpy as np
import os
import lula
from scipy.spatial.transform import Rotation as R

import carb
from omni.isaac.core.utils.extensions import get_extension_path_from_name
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core.articulations import Articulation
from omni.isaac.core.utils.nucleus import get_assets_root_path
from omni.isaac.core.objects.cuboid import FixedCuboid
from omni.isaac.core.prims import XFormPrim
from omni.isaac.core.utils.numpy.rotations import rot_matrices_to_quats
from omni.isaac.core.utils.prims import delete_prim, get_prim_at_path

from omni.isaac.motion_generation import (
LulaCSpaceTrajectoryGenerator,
LulaTaskSpaceTrajectoryGenerator,
LulaKinematicsSolver,
ArticulationTrajectory
)

class KukaTrajectoryGenerationExample():
def init(self):
self._c_space_trajectory_generator = None
self._taskspace_trajectory_generator = None
self._kinematics_solver = None

    self._action_sequence = []
    self._action_sequence_index = 0

    self._articulation = None

def load_example_assets(self):
    # Add the Franka and target to the stage
    # The position in which things are loaded is also the position in which they

    robot_prim_path = "/Kuka_KR210"
    path_to_robot_usd = "C:/Users/albertazzia2/Desktop/Daniellerobot/urdf_files_dataset-main/urdf_files/ros-industrial/kuka/kuka_kr210_support/urdf/kr210l150/kr210l150.usd"



    add_reference_to_stage(path_to_robot_usd, robot_prim_path)
    self._articulation = Articulation(robot_prim_path)

    # Return assets that were added to the stage so that they can be registered with the core.World
    return [self._articulation]




def setup(self):
    # Config files for supported robots are stored in the motion_generation extension under "/motion_policy_configs"
    mg_extension_path = get_extension_path_from_name("omni.isaac.motion_generation")
    rmp_config_dir = os.path.join(mg_extension_path, "motion_policy_configs")
    
 

    self._taskspace_trajectory_generator = LulaTaskSpaceTrajectoryGenerator(
        robot_description_path = rmp_config_dir + "/Kuka/kr210/rmpflow/kuka_kr210_robot_description.yaml",
        urdf_path = "C:/Users/albertazzia2/Desktop/Daniellerobot/urdf_files_dataset-main/urdf_files/ros-industrial/kuka/kuka_kr210_support/urdf/kr210l150.urdf"
    )

    
    self._end_effector_name = "tool0"



def setup_taskspace_trajectory(self):

    task_space_position_targets = np.array([

        [1.0, -1.0, 1.0],
        [-1.0, -1.0, 1.0],
        [-1.0, 1.0, 1.0],

    ])
     
    
    quat = R.from_euler('xyz', [0, 90, 0], degrees=True).as_quat()  # [x, y, z, w]
    x,y,z,w = quat
    # Ora crea gli orientation targets
    task_space_orientation_targets = np.tile([w,x,y,z], (5, 1))

    trajectory = self._taskspace_trajectory_generator.compute_task_space_trajectory_from_points(
        task_space_position_targets, task_space_orientation_targets, self._end_effector_name
    )

    # Visualize task-space targets in task space
    for i,(position,orientation) in enumerate(zip(task_space_position_targets,task_space_orientation_targets)):
        add_reference_to_stage(get_assets_root_path() + "/Isaac/Props/UIElements/frame_prim.usd", f"/visualized_frames/target_{i}")
        frame = XFormPrim(f"/visualized_frames/target_{i}",scale=[.04,.04,.04])
        frame.set_world_pose(position,orientation)

    if trajectory is None:
        carb.log_warn("No trajectory could be computed")
        self._action_sequence = []
    else:
        physics_dt = 1/60
        articulation_trajectory = ArticulationTrajectory(self._articulation, trajectory, physics_dt)

        # Get a sequence of ArticulationActions that are intended to be passed to the robot at 1/60 second intervals
        self._action_sequence = articulation_trajectory.get_action_sequence()

def update(self, step: float):
if len(self._action_sequence) == 0:
return

    if self._action_sequence_index >= len(self._action_sequence):
        self._action_sequence_index += 1
        self._action_sequence_index %= len(self._action_sequence) + 10 # Wait 10 frames before repeating trajectories
        return

    if self._action_sequence_index == 0:
        self._teleport_robot_to_position(self._action_sequence[0])

    self._articulation.apply_action(self._action_sequence[self._action_sequence_index])

    self._action_sequence_index += 1
    self._action_sequence_index %= len(self._action_sequence) + 10 # Wait 10 frames before repeating trajectories

def reset(self):
    # Delete any visualized frames
    if get_prim_at_path("/visualized_frames"):
        delete_prim("/visualized_frames")

    self._action_sequence = []
    self._action_sequence_index = 0

def _teleport_robot_to_position(self, articulation_action):
    initial_positions = np.zeros(self._articulation.num_dof)
    initial_positions[articulation_action.joint_indices] = articulation_action.joint_positions

    self._articulation.set_joint_positions(initial_positions)
    self._articulation.set_joint_velocities(np.zeros_like(initial_positions))
1 Like

@arianna.albertazzi thanks for your input! Let me share this information with our internal team.

@arianna.albertazzi unfortunately the joint limit you changed to doesn’t align with KUKA kr210 datasheet (Please check Axis 1 (A1)). I have already reached out to our internal team and they will look into this issue. Thanks for your patience!

1 Like