Hi @skwix7905,
Thanks for your question. If you use the Articulation set_joint_positions you can force the robot to any joint position you want. Simulation will still run to determine the torque that is required to get the robot to move to those trajectories, but the motion won’t be affected by gravity or anything else but the position you are setting.
Here is a simple script to do this
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
import numpy as np
from isaacsim import SimulationApp
# Create a simulation app instance
simulation_app = SimulationApp({"headless": False})
from isaacsim.core.api import World
from isaacsim.core.api.tasks import BaseTask
from isaacsim.core.utils.types import ArticulationAction
from isaacsim.robot.manipulators.examples.franka import Franka
# Create a world
my_world = World(stage_units_in_meters=1.0)
# Add default ground plane
my_world.scene.add_default_ground_plane()
# Add the Franka robot to the scene
franka = my_world.scene.add(
Franka(
prim_path="/World/Franka",
name="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 world to initialize scene
my_world.reset()
# Define target joint positions
target_positions = np.array([0.0, 0.3, 0.0, -1.5, 0.0, 1.8, 0.0, 0.0, 0.0])
joint_indices = np.arange(9, dtype=np.int32)
print("Simulation started. Setting Franka to target position.")
print("Press Ctrl+C to exit.")
# Define sinusoidal trajectory parameters
amplitude = np.array([0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.1, 0.1]) # Amplitude for each joint
frequency = np.array([4.5, 0, 0, 0, 0, 0, 0, 0, 0]) # Frequency for each joint
phase = np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 0.0, np.pi]) # Phase offset for each joint
center_position = np.array([0.0, 0.3, 0.0, -1.5, 0.0, 1.8, 0.0, 0.2, 0.2]) # Center position for oscillation
# Time counter for simulation
sim_time = 0.0
time_step = 1.0 / 60.0 # Assuming 60 Hz simulation
# Main simulation loop
while simulation_app.is_running():
# Calculate joint positions based on sinusoidal trajectory
joint_positions = center_position + amplitude * np.sin(2 * np.pi * frequency * sim_time + phase)
# Set joint positions
franka.set_joint_positions(joint_positions, joint_indices=joint_indices)
# Step the simulation
my_world.step(render=True)
# Update simulation time
sim_time += time_step
# Cleanup
simulation_app.close()