Unity Simulation Setup

Thank you for this outstanding submission. We’ve added points for you, considering the usefulness of such environment for both Challenges (as it was submitted before the Challenge 2 was dropped).

Below you’ll find some extra feedback from one of our experts:

Done well

  • All the key functionalities (/cmd_vel, /imu, /clock, ZED video, depth, point clouds, etc.) are working good. It is a solid simulation, which for sure will be very useful in development.
  • The Mars Yard and Panther models are beautifully imported with full color and detail.
  • The vehicle physics are quite realistic, and the Panther model behaves well on flat terrain.
  • Your custom implementation of the ZED sensors is well made with shaders and the GPU->C#->ROS extraction script. It was a nice touch to do point cloud generation right there in Unity.
  • Excellent reasons for choosing Unity over Gazebo. Particularly the photorealistic visuals will surely be helpful for testing CV.

Suggestions for improvement

Vehicle physics

Currently Panther struggles to climb slopes due to low tire friction:

  • Consider increasing friction stiffness, as well as increasing wheel torque and damping for better traction.
  • Lowering the center of mass should help with stability on slopes. You can do that by unchecking “Automatic Center of Mass” in Panther’s RB.
    If cmd_vel messages stop, it would be safer for the robot to stop after a timeout, instead of continuing to drive indefinitely.
    When using WSAD to control Panther directly in Unity, it’s not possible to press W + A/D together to drive in a curve

ROS integration

These are mostly performance related:

The Unity->ROS image publisher currently doesn’t support image_transport compression. Only image_raw is published, which might hurt performance. A particular problem might occur if that limitation causes you to subscribe raw in deployment, in which scenario ROS might start struggling with bandwidth while the images are being sent over WiFi.
The camera frame rate is capped at 10 FPS even with low resolution, while CPU usage remains low.

  • This may be due to bottlenecks in your image processing pipeline or overhead from C# in Unity or Python in ROS-TCP-Endpoint.
  • Consider offloading large per-pixel loops like point cloud generation and depth rescaling from C# to shaders or C++ code.
  • Regarding ROS-TCP-Endpoint performance issues: ROS-TCP-Endpoint performance issue #172.

Architecture

Currently, Panther’s and ZED’s object hierarchies are defined directly inside of the Mars Yard scene. Turning these into prefabs would aid reusability.
Would be great if the project was a ROS2 package, with a launch file that starts Unity alongside ROS-TCP-Endpoint, which would make it quicker and easier to run the simulation.

1 Like