Franka unable to move using PickPlaceController

Topic Description

Detailed Description

I am running VSCode through Remote SSH, and running Isaac Sim on AWS Cloud EC2 instance. I tried to run this Python code on a new Python file.

> from omni.isaac.franka import Franka
> from omni.isaac.core import World
> from omni.isaac.core.objects import DynamicCuboid
> from omni.isaac.franka.controllers import PickPlaceController
> import numpy as np
> 
> world = World()
> world.scene.add_default_ground_plane()
> franka = Franka(prim_path="/World/Franka", name="swsswaswafvesawwfv")
> cube = DynamicCuboid(
>         prim_path="/World/random_cube",
>         name="cafcaXwwcvw",
>         position=np.array([0.3, 0.3, 0.3]),
>         scale=np.array([0.0515, 0.0515, 0.0515]),
>         color=np.array([0, 0, 1.0]),
>         )
> controller = PickPlaceController(name="pick_place_controller",
>             gripper=franka.gripper,
>             robot_articulation=franka,
>             events_dt=[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
>         )
> world.scene.add(franka)
> world.scene.add(cube)
> 
> franka.initialize()
> 
> franka.set_joint_positions(np.array([1.0, -1.0, 0.0, -2.2, 0.0, 2.4, 0.8, 0.04, 0.04]))
> goal_pos = np.array([-0.3, -0.3, 0.3])
> print(f"franka's initial joint positions: {franka.get_joint_positions()}")
> 
> while not controller.is_done():
>     current_pos = franka.get_joint_positions()
>     print("world is playing")
>     cube_pos, _ = cube.get_local_pose()
>     pick_place_action = controller.forward(
>         picking_position=cube_pos,
>         placing_position=goal_pos,
>         current_joint_positions=current_pos
>     )
>     franka.apply_action(pick_place_action)
>     print(pick_place_action)
>     print(f"cube position: {cube_pos} and goal_pos: {goal_pos}")
>     print(f"current event: {controller.get_current_event()}")
> 
> if (controller.is_done()) :
>     print("Done")
>     controller.reset()

While all 8 events of my PickPlaceController finished (based on my output), Franka doesn't seem to move.

I tried to add in world.step(render=True) but I had errors: 
> Traceback (most recent call last) Traceback (most recent call last):
>   File "/root/.local/share/ov/data/Kit/Isaac-Sim/4.2/exts/3/isaacsim.code_editor.vscode-1.0.5/isaacsim/code_editor/vscode/executor.py", line 78, in execute
>     result = eval(code, self._globals, self._locals)
>   File "<string>", line 32, in <module>
>   File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/world/world.py", line 536, in step
>     SimulationContext.step(self, render=render)
>   File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py", line 688, in step
>     if self.get_physics_dt() == 0:
>   File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py", line 472, in get_physics_dt
>     return self._physics_context.get_physics_dt()
> AttributeError: 'NoneType' object has no attribute 'get_physics_dt'

What is wrong? Also, do i need to use SimulationApp?

Please upgrade to the latest version (4.5.0) and see if using Visual Studio Code to go through the tutorial will help: Adding a Manipulator Robot — Isaac Sim Documentation.