I want to use a ROS topic to manipulate specific USD properties. In particular, I would like publish something like a ‘enabled’ or ‘disabled’ on a ROS topic to set a specific collider on a mesh in Isaac Sim to ‘Collision enabled’ or ‘Collision disabled’.
My impression is that there is no feature in ROS2Bridge that supports this at the moment. I might be interested in implementing something using the Isaac API using Python, if it is not too difficult.
Could someone give me some directions on how to proceed? I have some very basic knowledge of the Omniverse/Isaac Python API.
I need some advice setting this up. I was able to activate the extension in Isaac Sim. When Isaac is running, I see some services:
brunovetter@brunovetter-Blade-17-Mid-2021-RZ09-0406:~$ ros2 service list
/OmniAddOnRos2Bridge/describe_parameters
/OmniAddOnRos2Bridge/get_parameter_types
/OmniAddOnRos2Bridge/get_parameters
/OmniAddOnRos2Bridge/list_parameters
/OmniAddOnRos2Bridge/set_parameters
/OmniAddOnRos2Bridge/set_parameters_atomically
I do not see any service like /get_prims yet. Looking at the README, I do not understand completely what to do next. I would like to make a simple service call from the ros2 cli.
My knowledge about ROS2-Services is at a basic tutorial level.
The README tells me:
The ROS2 package add_on_msgs contains the definition of the messages (download and add it to a catkin workspace).
Is this the missing part? I have a ROS2 workspace that I use with colcon. I put the add_on_msgs folder below my src folder and executed a colcon build (never used catkin).
After that, under /install/add_on_msgs, I get this directory structure:
I think part of what I was missing is the ‘RosAttribute’. I just created one in my scene and now I see the missing services (also found that the simulation must be running). Let me check if I can proceed now.
2022-01-13 12:46:20 [4,562,001ms] [Error] [omni.physx.plugin] PhysX error: PxShape::setFlag() not allowed while simulation is running. Call will be ignored., FILE /buildAgent/work/c6f19e3bba7d41ab/source/physx/src/NpShape.cpp, LINE 719
2022-01-13 12:46:20 [4,562,001ms] [Error] [omni.physx.plugin] PhysX error: PxShape::setFlag() not allowed while simulation is running. Call will be ignored., FILE /buildAgent/work/c6f19e3bba7d41ab/source/physx/src/NpShape.cpp, LINE 719
2022-01-13 12:46:20 [4,562,001ms] [Error] [omni.physx.plugin] PhysX error: PxScene::resetFiltering() not allowed while simulation is running. Call will be ignored., FILE /buildAgent/work/c6f19e3bba7d41ab/source/physx/src/NpScene.cpp, LINE 2439
There is an update of the extension in which this problem is fixed.
Please, upgrade the current version of your extension and let me know if everything is working good :)
I have updated the extensions via the extensions manager and restarted Isaac Sim. After the update, I cannot access the attribute anymore. On the command line, this is what I get:
brunovetter@brunovetter-Blade-17-Mid-2021-RZ09-0406:~/dev_ws$ ros2 service call /set_attribute add_on_msgs/srv/SetPrimAttribute '{path: "/World/track_colliders/TrackColliders/s01s/s01s", attribute: "physics:collisionEnabled", value: "false"}' && ros2 service call /set_attribute add_on_msgs/srv/SetPrimAttribute '{path: "/World/track_colliders/TrackColliders/s01l/s01l", attribute: "physics:collisionEnabled", value: "true"}'
waiting for service to become available...
requester: making request: add_on_msgs.srv.SetPrimAttribute_Request(path='/World/track_colliders/TrackColliders/s01s/s01s', attribute='physics:collisionEnabled', value='false')
response:
add_on_msgs.srv.SetPrimAttribute_Response(success=False, message='The timeout (2.5s) for setting the attribute value has been reached')
Removing and reinstalling the extension does not help, unfortunately.
I am attaching a test scene I used to reproduce the issue. This is the output (get_attribute works, set_attribute does not):
brunovetter@brunovetter-Blade-17-Mid-2021-RZ09-0406:~/dev_ws$ ros2 service call /get_attribute add_on_msgs/srv/GetPrimAttribute '{path: "/World/Cube", attribute: "doubleSided"}'
waiting for service to become available...
requester: making request: add_on_msgs.srv.GetPrimAttribute_Request(path='/World/Cube', attribute='doubleSided')
response:
add_on_msgs.srv.GetPrimAttribute_Response(value='true', type='bool', success=True, message='')
brunovetter@brunovetter-Blade-17-Mid-2021-RZ09-0406:~/dev_ws$ ros2 service call /set_attribute add_on_msgs/srv/SetPrimAttribute '{path: "/World/Cube", attribute: "doubleSided", value: "false"}'
waiting for service to become available...
requester: making request: add_on_msgs.srv.SetPrimAttribute_Request(path='/World/Cube', attribute='doubleSided', value='false')
response:
add_on_msgs.srv.SetPrimAttribute_Response(success=False, message='The timeout (2.5s) for setting the attribute value has been reached')
Many thanks for sharing the .usd file and for testing this extension
Now, there is an updated version of the extension where the problem is solved (I just forgot to remove a return statement I placed during testing 🙈). Hope it works better now… If there is another problem, feel free to report it 😅
Seems to work now on the test setup. Big hand for the quick fix!
I will continue testing in a larger setup.
One more question: Is it correct that certain attributes cannot be accessed? In particular, I have a reference to a usd file in a prim that I would like to change dymanically, but it seems the reference is not part of the attributes I can change.