Help aquiring end-efffector velocity data from class omni.isaac.orbit.assets.RigidObjectData


I’m developing a Cartesian impedance control simulation for a panda robot, using as controller the controller from from omni.isaac.orbit.controllers.operational_space.
To compute the target joint torques the controller asks for the end effector velocity, which I’m struggling to get. This is the method from the controllers class

def compute(
        jacobian: torch.Tensor,
        ee_pose: torch.Tensor | None = None,
        ee_vel: torch.Tensor | None = None,
        ee_force: torch.Tensor | None = None,
        mass_matrix: torch.Tensor | None = None,
        gravity: torch.Tensor | None = None,
    ) -> torch.Tensor:

Into my code, I managed to get the pose for the end-effector through body_state_w and then computing the pose in the base frame. This is my simulation loop code so far:

 # define simulation stepping
    sim_dt = sim.get_physics_dt()
    count = 0
    count_error = 0
    # loop
    while simulation_app.is_running():
        # reset 
        if count % 150 == 0:
            # reset time
            count = 0
            # reset articulation state
            joint_pos_default =
            joint_vel_default =
            robot.write_joint_state_to_sim(joint_pos_default, joint_vel_default)
            # reset actions
            goal_command[:] = ee_goals[current_goal_idx]
            # reset robot joint positions
            joint_pos_default = joint_pos_default[:, robot_entity_cfg.joint_ids].clone()
            joint_vel_default = joint_vel_default[:, robot_entity_cfg.joint_ids].clone()
            joint_torques_desired = torch.zeros(1, 7, device=robot.device)
            # reset controller
            # set command
            # change goal
            current_goal_idx = (current_goal_idx + 1) % len(ee_goals)
            # read information from simulation
            # jacobian
            jacobian = robot.root_physx_view.get_jacobians()[:, ee_jacobi_idx, :, robot_entity_cfg.joint_ids]
            # state of all bodies ([pos, quat, lin_vel, ang_vel])
            ee_pose_w =[:, robot_entity_cfg.body_ids[0], 0:7]
            # root state [pos, quat, lin_vel, ang_vel]
            root_pose_w =[:, 0:7]
            # compute frame in root frame 
            asset instances are not “aware” of the local environment frame, they return their states in the simulation world frame. Thus, we need to convert the obtained quantities to the local environment frame. This is done by subtracting the local environment origin from the obtained quantities.
            ee_pos_b, ee_quat_b = subtract_frame_transforms(
                root_pose_w[:, 0:3], root_pose_w[:, 3:7], ee_pose_w[:, 0:3], ee_pose_w[:, 3:7]
            # merge the position and orientation
            ee_pose_b =[ee_pos_b, ee_quat_b], dim=-1)
            # compute the end-effector velocity
            ee_vel_b =
            print(f"ee_vel_b: {ee_vel_b}")

            # compute the joint commands
            joint_torques_desired = op_controller.compute(jacobian, ee_pose_b, ee_vel_b)

I want to compute the velocity too and I have looked into the documentation in this link:

I have some doubts about how should I get the velocity term cause I see that I should use body_state_w function to get the velocity, but I dont know what to use as argument to get the end effector velocity. Someone can help me?
I dont fully understand how ee_pose_w =[:, robot_entity_cfg.body_ids[0], 0:7] works. The documentation says that holds [pos, quat, lin_vel, ang_vel] data and the shapes is “Shape is (num_instances, num_bodies, 13)”, though, I dont understand exactly that 13, I’m sure its super obvious but I dont see it

Thanks in advance!