Hello community,
I wonder if there is the possibility to create articulations with position control without the physics (pure kinematics). The aim is to create simulation with assigned motion laws.
And or, work with assigned motion law and physics and be able to compute the dynamics as multibody system.
Isaac Sim Version
4.5.0
Operating System
Ubuntu 22.04
GPU Information
- Model: NVIDIA L40S
- Driver Version: 575
Topic Description
Detailed Description
The problem is that position controller for robot joints have dynamic parameters such as stiffness, damping etc… Which needs to be setup otherwise the simulation is not happening. However, if I don’t know how to create a simpler simulation which shows the robot movement assigning a motion law: (position(t), speed(t), acceleration(t), t=sim_time_step). This can be useful also for multibody study where motion law is assigned and you need to retrieve forces/torques applied.
Hi @federico.insero01, thank you for your question. Yes, you can create articulations and set their joint positions directly with set_joint_positions.
Here is an example:
# Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import numpy as np
import time
from isaacsim import SimulationApp
# Create simulation app (not headless so we can see the robot)
simulation_app = SimulationApp({"headless": False})
from isaacsim.core.api import World
from isaacsim.robot.manipulators.examples.franka import Franka
# Create world with CPU backend
my_world = World(stage_units_in_meters=1.0)
print("Using CPU backend")
# Add default ground plane
my_world.scene.add_default_ground_plane()
# Add Franka robot to the scene
my_franka = my_world.scene.add(
Franka(
prim_path="/World/Franka",
name="my_franka",
gripper_dof_names=["panda_finger_joint1", "panda_finger_joint2"],
end_effector_prim_name="panda_rightfinger",
gripper_open_position=np.array([0.4, 0.4]) / 0.01,
gripper_closed_position=np.array([0.0, 0.0]),
)
)
# Reset the world to apply changes
my_world.reset()
# Get initial joint positions and number of joints
initial_positions = my_franka.get_joints_state().positions
num_joints = len(initial_positions)
print(f"Number of joints: {num_joints}")
print("Initial joint positions:", initial_positions)
# Sinusoidal motion parameters
frequency = 2.0 # Hz - how fast the sine wave oscillates
amplitude = 0.3 # radians - how far each joint moves from its initial position
phase_offset = np.linspace(0, 2*np.pi, num_joints, endpoint=False) # Different phase for each joint
# Get current time for animation
start_time = time.time()
# Main simulation loop
print("Starting sinusoidal joint motion")
while simulation_app.is_running():
# Calculate current time
current_time = time.time() - start_time
# Calculate sinusoidal positions for each joint
sinusoidal_positions = np.zeros(num_joints)
for i in range(num_joints):
# Create sinusoidal motion: initial_position + amplitude * sin(2π * frequency * time + phase_offset)
sinusoidal_positions[i] = initial_positions[i] + amplitude * np.sin(2 * np.pi * frequency * current_time + phase_offset[i])
my_franka.set_joint_positions(sinusoidal_positions)
# Step the simulation
my_world.step(render=True)
# Cleanup
simulation_app.close()
I believe that physics will still compute the dynamics of the articulation.
Hello!
We noticed that this topic hasn’t received any recent responses, so we are closing it for now to help keep the forum organized.
If you’re still experiencing this issue or have additional questions, please feel free to create a new topic with updated details. When doing so, we recommend mentioning or linking to this original topic in your new post—this helps provide context and makes it easier for others to assist you.
Thank you for being part of the NVIDIA Isaac Sim community.
Best regards,
The NVIDIA Isaac Sim Forum Team