Hello!
I have attached a simple script for a franka pushing a cube. I wanted to speed up the simulation by changing the physics step size and min_simulation_frame_rate. However, there is no change in the speed of the simulation.
In addition, I am not quite sure whether stepping is using gpu or not. When I enable gpu dynamics from physics scene in the gui, the simulation gets slower.
Here is the code and runtime information.
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
from omni.isaac.core import World
from omni.isaac.core.objects import DynamicCuboid
from omni.isaac.franka import Franka
from omni.isaac.franka import KinematicsSolver
import numpy as np
world = World()
world.scene.add_default_ground_plane()
franka = world.scene.add(Franka(prim_path="/World/Fancy_Franka", name="fancy_franka"))
world.reset()
fancy_cube = world.scene.add(DynamicCuboid(
prim_path="/World/random_cube",
name="fancy_cube",
position=np.array([0.1, 0.6, 0.1]),
scale=np.array([0.5, 0.5, 0.5]),
color=np.array([0, 0, 1.0]),
))
solver = KinematicsSolver(franka)
current_joint_positions = franka.get_joint_positions()
cube_position,_ = fancy_cube.get_world_pose()
goal_config = solver.compute_inverse_kinematics(cube_position)[0]
joint_positions = goal_config.joint_positions
steps = 2000
a1 = np.linspace(current_joint_positions[0],joint_positions[0],steps)
a2 = np.linspace(current_joint_positions[1],joint_positions[1],steps)
a3 = np.linspace(current_joint_positions[2],joint_positions[2],steps)
a4 = np.linspace(current_joint_positions[3],joint_positions[3],steps)
a5 = np.linspace(current_joint_positions[4],joint_positions[4],steps)
a6 = np.linspace(current_joint_positions[5],joint_positions[5],steps)
a7 = np.linspace(current_joint_positions[6],joint_positions[6],steps)
for i in range(steps):
goal = np.array([a1[i],a2[i],a3[i],a4[i],a5[i],a6[i],a7[i],joint_positions[7],joint_positions[8]])
goal_config.joint_positions = goal
franka.apply_action(goal_config)
world.step(render = True)
world.reset()
simulation_app.close()
I would be grateful if you could give me any hints on how to speed up the simulation without affecting the physics. Thank you!