Simulate drive velocity"Sudden STOP"

Hi,

Is this the best way to simulate a sudden stop to see the momentum effect of 2 flywheels?

from pxr import Sdf, Gf, UsdPhysics, UsdLux, PhysxSchema
from omni.isaac.dynamic_control import _dynamic_control


stage = omni.usd.get_context().get_stage()

 # get handle to the Drive API for both wheels
flywheel_left_joint = UsdPhysics.DriveAPI.Get(stage.GetPrimAtPath("/World/omni_redo/arm_1/Revolute_21"), "angular")
flywheel_right_joint= UsdPhysics.DriveAPI.Get(stage.GetPrimAtPath("/World/omni_redo/arm_1/Revolute_22"), "angular")

# Set the velocity drive target in degrees/second
flywheel_left_joint.GetTargetVelocityAttr().Set(0)
flywheel_right_joint.GetTargetVelocityAttr().Set(0)

#flywheel_left_joint_path = "/World/omni_redo/arm_1/Revolute_21"
#flywheel_right_joint_path = "/World/omni_redo/arm_1/Revolute_22"
#/World/omni_redo/arm_1/Revolute_21.drive:angular:physics:targetVelocity

import time
time.sleep(5)

# Set the velocity drive target in degrees/second
flywheel_left_joint.GetTargetVelocityAttr().Set(5000)
flywheel_right_joint.GetTargetVelocityAttr().Set(-5000)

time.sleep(5)

flywheel_left_joint.GetTargetVelocityAttr().Set(0)
flywheel_right_joint.GetTargetVelocityAttr().Set(0)

time.sleep(5)

flywheel_left_joint.GetTargetVelocityAttr().Set(-6000)
flywheel_right_joint.GetTargetVelocityAttr().Set(6000)

Appreciate any help or guidance.
Thanks

The DriveAPI under the hood uses PD controllers for joint control, in other words this internally uses something F = PDelta(p) + Ddelta(V). Ignoring the positional part for now, this means the actuation force of the joint will be proportional to the velocity in your case. However, this might be different from the velocity/force profile you will get from the physical breaks based on dry friction.
If you have a more accurate physics model of the breaks you can also try using exherting external force to the joint according to your model instead of using driveAPI. See set_joint_efforts API in isaac.core.articulation_view for more information.