A* path planning with ROS and Unity
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.
Asked by tron8196 on 2023-04-17 05:50:50 UTC
Answers
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 https://github.com/RobotecAI/ros2-for-unity 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?
Asked by ljaniec on 2023-04-17 07:55:52 UTC
Comments
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.
Asked by tron8196 on 2023-04-17 08:10:18 UTC
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
Asked by ljaniec on 2023-04-18 14:56:16 UTC
Comments