ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

A* path planning with ROS and Unity

asked 2023-04-17 05:50:50 -0600

tron8196 gravatar image

I am a beginner in ROS-UNITY integration. I have developed a A* path-planning algorithm for ROS and it works perfectly well when visualized in RVIZ. I wan't the same visualization in unity, including the obstacles. I am unable to figure out how to make ROS and Unity share the same world coordinates and map structure.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-04-17 07:55:52 -0600

ljaniec gravatar image

One thing is not clear to me - how are you using A* path planning now? Do you have some synthetic map and you want to have the same world in the Unity simulation?

I used to play with Unity as a simulator with a SLAM-based map (so no synthetic map before start of the simulation). I had to transform the coordinates from and to Unity, a nice description is here:

(don't use ROS# thought, it is outdated - this is better [ROS 2 only])

What exactly do you want to prepare beforehand as the map? Maybe you can prepare a script that generates the world, then map it with SLAM and use with your path planning?

edit flag offensive delete link more


Yes, I do have a synthetic map designed in Unity with a start and a goal defined and some obstacles as well. I wan't to use ROS for path planning such that it has a ame reference map for planning.

tron8196 gravatar image tron8196  ( 2023-04-17 08:10:18 -0600 )edit

I would start with generating a single simple element like a cube in the empty world, with coordinates given from the ROS node to check your transformations - you want to have correct /tf to translate every coordinate ROS <---> Unity.

Use these as a hint:

  • Unity: Forward: Z, Right: X, Up: Y, Rotation: clockwise

  • ROSy: Forward: X, Right: -Y, Up: Z, Rotation: counter-clockwise

ljaniec gravatar image ljaniec  ( 2023-04-18 14:56:16 -0600 )edit

Question Tools

1 follower


Asked: 2023-04-17 05:50:50 -0600

Seen: 446 times

Last updated: Apr 17 '23