Repository navigation
ROS topic issues (syncing/hz) #19
Description
Activity
What Wifi version are you using? Do you ping it while using the dog? What is the average delay in your network? (in ms)
Hi @delenius , I was also facing the same problem, and here's how I fixed it.
Some general information:
- Ubuntu 22.04
- ROS2 Humble
- Isaac Sim 4.1.0
- Situation: running
./run_sim.shwith--robot_amount 1under the root of go2_omniverse. While echoing the/robot0/point_cloud2topic, stamp is always 0.
The reason is that ROS_Clock is not set in
./run_sim.shfile, or more precisely, not in theomniverse_sim.pyfile if we dig into the run_sim.sh file. This webpage from Omniverse shows how to add a ROS_Clock in it. So here are some steps that we have to do.First, open
omnigraph.pyin your go2_omniverse workspace and add the following code right under thecreate_front_cam_omnigraphfunction. Note that there are some small modifications comparing to omniverse webpage.def create_ros2_clock(): graph_path = f"/ROS_Clock" og.Controller.edit( {"graph_path": graph_path, "evaluator_name": "execution", "pipeline_stage": og.GraphPipelineStage.GRAPH_PIPELINE_STAGE_SIMULATION,}, { og.Controller.Keys.CREATE_NODES: [ ("ReadSimTime", "omni.isaac.core_nodes.IsaacReadSimulationTime"), ("Context", "omni.isaac.ros2_bridge.ROS2Context"), ("PublishClock", "omni.isaac.ros2_bridge.ROS2PublishClock"), ("OnPlaybackTick", "omni.graph.action.OnPlaybackTick"), ], og.Controller.Keys.CONNECT: [ ("OnPlaybackTick.outputs:tick", "PublishClock.inputs:execIn"), ("ReadSimTime.outputs:simulationTime", "PublishClock.inputs:timeStamp"), ("Context.outputs:context", "PublishClock.inputs:context"), ], og.Controller.Keys.SET_VALUES: [ ("PublishClock.inputs:topicName", "/clock"), ("Context.inputs:domain_id", 1), ], }, )
Second, go back to
omniverse_sim.py. Find the line that writesfrom omnigraph import create_front_cam_omnigraph. Import ourcreate_ros2_clock, namely:from omnigraph import create_front_cam_omnigraph, create_ros2_clock
and add
create_ros2_clock()undercreate_front_cam_omnigraph(i)in therun_simfunction.
If we run./run_sim.shnow, the ROS_Clock action graph can be seen at the stage, which is at the top left of the Isaac Sim window. A/clocktopic also appears if you run topic list. However, if you runros2 topic echo /robot0/point_cloud2, the time stamp is still 0. This is due toRobotBaseNode.Third, open
ros2.pyin go2_omniverse workspace and find theRobotBaseNodeclass. Go topublish_lidarand we see that no time stamp is written (while stamp is defined in imu and odom). Simple add the codepoint_cloud.header.stamp = self.get_clock().now().to_msg()
under
point_cloud.header = Header(frame_id="odom"). Now the Isaac Sim should publish all the sensor data with time stamp. Hope it works to you!Reacted by NuralemHello @richard98hess444 ! Thanks for your contribution! Could you let me know how you ran this repo on 4.1? In my case, I face freezing and time in simulation is very slow.
Hi @abizovnuralem !
Besides the pre-requirements, I simply followed your instructions and everything was fine. I commanded out some lines likeparser.add_argument("--cpu", action="store_true", default=False, help="Use CPU pipeline.")andsetup_custom_env()inomniverse_sim.pywhenever I met build errors. Isaac Sim is slow especially I load my own map, but still acceptable. It works on my two laptops with RTX3070 and 2060, both using Isaac Sim 4.1.0.He @richard98hess444 ! Currently, this repo only supports 4.0 version, if you use 4.1 it will be laggy and slow. This is a known issue with 4.1, your laptop is powerful enough to do real-time. refer to #26 #30
Reacted by Richard WangJust updated the repo and fixed the speed issue.
Reacted by Richard Wang
The command
ros2 topic hz /robot0/front_cam/rgbdoes not return any info (even though I am getting images through it).All the other topics report some data.
I am not able to sync the
/robot0/front_cam/rgband/robot0/point_cloud2topics usingmessage_filters.ApproximateTimeSynchronizer(or plainTimeSynchronizer). I can sync all the other topics. Any idea why?/robot0/point_cloud2has timestamps of 0 for all messages, like this:(perhaps this is why no hz can be computed).
Note: I am using
RMW_IMPLEMENTATION=rmw_cyclonedds_cppas it solved some issues I had (the default dds did not work across different user accounts).