Giter Club home page Giter Club logo

Comments (4)

richard98hess444 avatar richard98hess444 commented on August 30, 2024 1

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.sh with --robot_amount 1 under the root of go2_omniverse. While echoing the /robot0/point_cloud2 topic, stamp is always 0.

The reason is that ROS_Clock is not set in ./run_sim.sh file, or more precisely, not in the omniverse_sim.py file 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.py in your go2_omniverse workspace and add the following code right under the create_front_cam_omnigraph function. 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 writes from omnigraph import create_front_cam_omnigraph. Import our create_ros2_clock, namely:

from omnigraph import create_front_cam_omnigraph, create_ros2_clock

and add create_ros2_clock() under create_front_cam_omnigraph(i) in the run_sim function.
If we run ./run_sim.sh now, the ROS_Clock action graph can be seen at the stage, which is at the top left of the Isaac Sim window. A /clock topic also appears if you run topic list. However, if you run ros2 topic echo /robot0/point_cloud2, the time stamp is still 0. This is due to RobotBaseNode.

Third, open ros2.py in go2_omniverse workspace and find the RobotBaseNode class. Go to publish_lidar and we see that no time stamp is written (while stamp is defined in imu and odom). Simple add the code

point_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!

from go2_omniverse.

abizovnuralem avatar abizovnuralem commented on August 30, 2024

What Wifi version are you using? Do you ping it while using the dog? What is the average delay in your network? (in ms)

from go2_omniverse.

abizovnuralem avatar abizovnuralem commented on August 30, 2024

Hello @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.

from go2_omniverse.

richard98hess444 avatar richard98hess444 commented on August 30, 2024

Hi @abizovnuralem !
Besides the pre-requirements, I simply followed your instructions and everything was fine. I commanded out some lines like parser.add_argument("--cpu", action="store_true", default=False, help="Use CPU pipeline.") and setup_custom_env() in omniverse_sim.py whenever 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.

from go2_omniverse.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.