Isaac Sim Version
[*] 4.5.0
4.2.0
4.1.0
4.0.0
4.5.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):
Operating System
[*] Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):
Topic Description
When I obtain robot control commands through the ROS2 node and send them to apply_action()
, the following error occurs at some uncertain moments:
Codes
import numpy as np
import math
import rclpy
import os
from rclpy.node import Node
from geometry_msgs.msg import Point
from isaacsim.core.prims import XFormPrim
from isaacsim.core.api.robots import Robot
from isaacsim.core.utils.stage import add_reference_to_stage
from isaacsim.core.utils.types import ArticulationAction
class BodyControl(Node):
def __init__(self, env):
super().__init__("BodyControl_subscriber")
self.ros_world = env.ros_world
self.env = env
self.Trans = np.array([
[-1, 0, 0, 2],
[ 0, -1, 0, 2],
[ 0, 0, 1, 0],
[ 0, 0, 0, 1]])
self.Body_subscription = self.create_subscription(
Point,
'BodyControl_position',
self.position_callback,
10
)
self.TR_V4 = self.env.TR_V4
self.Body_subscription
self.joint_positions = np.array([0.0, 0.0, 0.0, -30 / 180 * 2 * math.pi])
self.ros_world.reset()
self.pending_position = None
self.joint_velocities=[1.5, 1.5, 0.6, 19]
def position_callback(self, msg):
if msg and hasattr(msg, "x") and hasattr(msg, "y") and hasattr(msg, "z"):
self.joint_positions = np.array([msg.x, msg.y, msg.z])
self.get_logger().info(f'Received position - X: {self.joint_positions[0]}, Y: {self.joint_positions[1]}, Z: {self.joint_positions[2]}')
self.joint_positions = np.dot(self.Trans, np.array([self.joint_positions[0], self.joint_positions[1], self.joint_positions[2], 1]).T)
self.move_robot()
self.pending_action = 'move'
else:
self.get_logger().warn("Received invalid position message")
def execute_pending_position(self):
if self.pending_position is not None:
self.joint_positions = self.pending_position
self.move_robot()
self.pending_position = None
def move_robot(self):
self.joint_positions_move_temp = [self.joint_positions[1] + 0.3, self.joint_positions[0] + 1.1, self.joint_positions[2] - 0.55, -30 / 180 * 2 * math.pi]
self.action = ArticulationAction(
joint_positions = self.joint_positions_move_temp,
joint_velocities = self.joint_velocities
)
self.TR_V4.apply_action(self.action)
actual_pos = np.dot(self.Trans, np.array([self.action.joint_positions[0], self.action.joint_positions[1], self.action.joint_positions[2], 1]).T)
self.get_logger().info(f'Moving robot to new joint positions: {np.array([actual_pos[0]+ 0.3,actual_pos[1] + 1.1,actual_pos[2] + 0.55])}')
Error Messages
2025-03-27 22:02:19 [141,966ms] [Error] [omni.physx.plugin] PhysX error: PxArticulationReducedCoordinate::copyInternalStateToCache() not allowed while simulation is running. Call will be ignored., FILE /builds/omniverse/physics/physx/source/physx/src/NpArticulationReducedCoordinate.cpp, LINE 197
or
2025-03-27 22:00:41 [43,793ms] [Error] [omni.physx.plugin] PhysX error: PxArticulationJointReducedCoordinate::setDriveVelocity() not allowed while simulation is running. Call will be ignored., FILE /builds/omniverse/physics/physx/source/physx/src/NpArticulationJointReducedCoordinate.cpp, LINE 328
2025-03-27 22:00:41 [43,794ms] [Error] [omni.physx.plugin] PhysX error: Concurrent API write call or overlapping API read and write call detected during fetchResults from thread 1665140288! Note that write operations to the SDK must be sequential, i.e., no overlap with other write or read calls, else the resulting behavior is undefined. Also note that API writes during a callback function are not permitted., FILE /builds/omniverse/physics/physx/source/physx/src/NpCheck.cpp, LINE 95
2025-03-27 22:00:41 [43,796ms] [Error] [omni.physx.plugin] PhysX error: Leaving setDriveVelocity on thread -859830720, an overlapping API read or write by another thread was detected., FILE /builds/omniverse/physics/physx/source/physx/src/NpCheck.cpp, LINE 127
2025-03-27 22:00:41 [43,796ms] [Error] [omni.physx.plugin] PhysX error: Overlapping API read and write call detected during getFlags from thread 1665140288! Note that read operations to the SDK must not be overlapped with write calls, else the resulting behavior is undefined., FILE /builds/omniverse/physics/physx/source/physx/src/NpCheck.cpp, LINE 49
2025-03-27 22:00:41 [43,797ms] [Error] [omni.physx.plugin] PhysX error: Concurrent API write call or overlapping API read and write call detected during setDriveVelocity from thread -859830720! Note that write operations to the SDK must be sequential, i.e., no overlap with other write or read calls, else the resulting behavior is undefined. Also note that API writes during a callback function are not permitted., FILE /builds/omniverse/physics/physx/source/physx/src/NpCheck.cpp, LINE 95
Related Issues
I’ve tried PhysX error occurs when I move joint with efforts control and ROS message but it doesn’t work for me
Additional Context
How can solve the problem?
Thanks!