• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by phillip71newman · Apr 30, 2013 at 09:42 AM · simulationrobot

Can Unity be used to simulate & develop robotic navigation systems

I need to map out a robots environment in 3D by "looking around" or perceiving the environment first by collecting point cloud data then simplifying it to meshes. The mesh will be stored on board as a semi-permanent data set that may be updated from time to time. The robot will plot routes/paths in this environment that it can follow/navigate. Various routes will be plotted and the best one selected for the particular task that it must perform.

I need to develop various aspects of this project such as: 1. Point cloud gathering through sensors. 2. Point cloud simplification/"meshing" 3. Route/path plotting. 4. Real Time Route/path navigation/following. 5. 3D Visualization of all the above steps.

My thinking is that many of the tasks above can be developed by simulation e.g. The robots path plotting routines or even advanced path following routines. Thus I can visualize the robot's environment and adjust/fine tune its behavior from behind a computer.

My question is: Can Unity be used for this kind of simulation and what software will be best suited to tie in with Unity?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Fattie · Apr 30, 2013 at 09:56 AM

To be honest the answer to your question is largely:

"No"

PhysX is a fantastic game-physics engine. But PhysX/Unity sort of have nothing to do with point clouds and that type of thing...just no relation. You're thinking more OpenMesh

For me in a project as you describe (exactly our field of interest) Unity3D is more just the front end. You know?

Look in to openMesh / openFlipper get to know Dr Jan, etc

http://www.openmesh.org

To be honest the real answer to your question is just "No".

Honestly the absolute least of your problems is doing a few raycasts which is like 3 calculations dude. If your project is at the level of figuring those sort fo system out there's quite a long ways to go eh!!

the key quote here is from Brooks ... "The world is its own best model"

Really the issues at the game engine level ("is there a line of sight?!") are just nothing. It would be like being worried about a volume control on a speaker, if, you were working on a big natural language audio processing research project.

So pretty much - I have to say "don't even bother with Unity" you know?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Apr 30, 2013 at 09:58 AM 0
Share

Just to repeat myself. You'd have to be an utter master of everything related to typical game engines and 3D modelling, as a strictly incidental matter, purely in terms of displaying your work and research processes

But other than that .. no. Note that for example Unity has very poor/sloppy connections to things like video inputs etc.

I could see in the future UnityForRoboticsResearch but it's a long long way away, and since there are 19 people who would need it it's not gonna happen.

avatar image phillip71newman · Apr 30, 2013 at 10:14 AM 0
Share

Thanks for your comment. I will follow up on openmesh etc...

avatar image
1

Answer by ketch · Jan 10, 2015 at 03:36 PM

I'm aware this was posted and answered some time ago but I'm curious for further discussion because this is relevant to me now.

I think that if your objectives are simulating navigation algorithms and creating engaging demonstrations of your work then Unity is a viable tool, but if your objectives are simulating the more physical aspects (the kinematic model of your robot, detailed sensor model), or integrating with real-world sensors etc then Unity would likely fall short.

The other day I found this 2011 paper from a conference in Mexico. They built a mobile robot simulation in Unity and offer up some informative points. http://www.uv.mx/rossum/CD/papers/005.pdf

My masters project is very similar - a mobile robot simulation which intends to enable the user to create their own mazes, customize the sensor configuration on robots, and provides an interface for writing your own navigation algorithms etc. It's in development and you can try it out here https://github.com/explosivose/botnavsim/releases/tag/v0.3.0-alpha

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by phillip71newman · Jan 11, 2015 at 11:18 AM

Thanks for your post. I will look into the document and app which you supplied. It will be interesting...

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xxmariofer · Jul 28, 2020 at 07:44 AM 1
Share

i know this is a really old question, but i do think that unity is a nice tool for integrating with robots, i have personally used unity with ROS and worked really, really well. personally i think that with ros, unity is one of the best software tools since it already gives a lot of the work done. I personally have successfully done autonomus navigation and created virtual worlds withthe information retrieve from 3d cameras/point clouds. although i have not used the physic engine of unity itself for this tasks

avatar image phillip71newman xxmariofer · Jul 28, 2020 at 08:29 AM 0
Share

Thank you for your comment. I need to take a closer look at ROS itself and ROS in Unity.

Since my very first post I have also successfully used Unity to simulate a robot's behavior including its physics which definitely will not 100% correspond to the real world physics, but close enough that I was able to use it to develop the firmware needed on the real world counter part. Unity was really helpful to quickly make changes and re-run the simulation 40 to 50 times a day. Since my robot operates in water, it is a very cumbersome task to reprogram the real world counter part, then test it, take it out of the water, dry it, change the code, reprogram it and repeat which can only be done so many times a day (about 5 ~ 10).

Using Unity led to rapid development of motion control algorithms and software methods to control the robot. I was able to simulate various real world sensors by using real world measured sensor data in look up tables and also induced noise in some of the other senors where needed to approximate them more accurately. I was able to cut and paste some of the code between Unity C# and my firmware C-code with little to almost no modification in some cases.

The bottom line is that Unity was in deed very helpful to develop robotic navigation systems and I will certainly continue to use it for the same purpose.

avatar image
0

Answer by thefuturebymob · Aug 02, 2020 at 02:44 PM

Hi,

I've worked on AAA game, and robotics. I have used Unity for both.

Unity has a lot of functionality, and the trick is not to get carried away and start designing an Agent/NPC that attempts to navigate the world using the Nav Mesh system. If you do that, when you migrate the code into your real world robot, the robot would need the game engine to move around ! I suppose you could actually take the maths used in your bespoke c# scripts and grab a 3d library instead - but you get the jist - you are not writing the robot code to use a game engine. See answer above from Fatte - I think they thought you meant what I've just described.

What you will be doing is using Unity to simulate a real world, so you can train and improve your robot navigation code.

The real benefit of using unity, and I think this is what you are really asking, is if you can train and develop algorithms for navigation using Unity as a world simulator. So in this case, yes you can use Unity. Let's say you want to move a robot around your house. There are 2 obstacle types (like most models) - static and dynamic. The static are the doorways, stairs, kitchen units etc. The dynamics are objects left around that dont move on their own ie the hoover (unless you have a robot hoover !!), and the objects that can move on their own ie your robots girlfriend, the dog etc. (note giant yoga balls can be considered this type with 0 velocity !)

Measure the rooms of the house in terms of floor space and put them into Unity. Connect the rooms etc via doorways etc. Create some assets for the objects that are dynamic but dont move too much ie sofa, chairs, tables etc - these are unlikely to be moved from the rooms they are mapped in, but can still be moved. Then make assets for objects that can be anywhere ie are moved around a lot but dont move on their own ie single chairs, and then finally make assets that can move themselves ie the dog, house guest.

Now create the level asset of your simulation in unity - randomize the dynamic objects., and you have a world sim. Add an update for the movement to the dynamic objects that can move themselves simply rotations, translations (no scaling !!) - you can use the navmesh to help with the movement simulation of these objects - remember none of this simulation code goes on the robot. And now you have a dynamic world simulation of your house

Now the good bit - hopefully it's an easy robot - eg a tracked robot not a humanoid - measure your robot, be careful with this - it needs a front direction (call it North), and dont measure just the foot print - does anything lean out/bend over etc. Model this as your character, and make sure you model the movement using your north direction (unless it can move in all directions equally well etc).

If you have moving parts on the robot that affect the size/footprint - this needs to be mapped or you can constrain the robot to worse case scenario - this can be very limiting (take volume of largest possible size)

Once you have the robot mapped, make sure you can randomize its location only on suitable surfaces ie not on any dynamic object, on floors where it can operate (ie it it can move on fitted rugs etc).

Now this is the really fun bit, the robot needs to have a set of atomics, things it can do in the real world ie move 1 cm forward, rotate etc You need to spend some time mapping these movements, but start simple ie forward, backward, left track move only, right track move only. Program these movements one in each function for example. See genetic programming for algorithms using atomics -this is very interesting - making new "genes" with fitness, random etc.

Use an algorithm so that each update on the scene allows the algorithm to do something to the robot s position.

If its an alg that requires training - then set a destination point for the robot, and then let the robot try each movement until it reaches its destination - woooaa - going to take a while ! Use heuristics - so choose a rule that progresses the robot to its goal, -this requires a way to measure progress etc.

For example add the permissible movement functions to a list, chose an item from the list, measure the distance to the destination, if the robot is closer then it's a winner move, keep that move (or try them all - chose the one that brings closest), but with this approach you will hit valleys and troughs, false peaks etc.

Once its trained well enough and you are happy with the number of moves/time (depends how you measure success), the code is ready to move to the robot. The only thing that changes is each update function (scene frame), needs a main loop to call it - this will be easy as all firmware runs like this ie no end. Then change the atomics functions to instead of moving your robot in the sim, actual control the HW that does those moves.

So all this does mean you can use Unity as a simulator, if you have more questions feel free to ask.

I used Unity for my robotic navigation system training. My robot has 6 raspberry Pis - a Pi4 vision module that uses opencv for face/object recog, a Pi4 Speech module Pi that uses pocket sphinx, speech simulator is HW, a Pi3 brain module Pi that controls the other modules via 0 message Q, creates and tracks jobs etc, a Pi3 mobility module - uses various navigation and tracking systems, a Pi4 Mind module - contains the personality and knowledge systems, and decision making - uses semantic networks, ANNs, and a personality engine, and finally a Pi4 Fun Module - plays games, movies, music, surfs web etc. all via a mini projector.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image phillip71newman · Aug 03, 2020 at 07:11 AM 0
Share

Thanks for your reply. $$anonymous$$mmm... quite a mouth full. I'm glad for your success in using Unity to help with your robot's navigation. Your robot sounds really complicated.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does the robot simulation contain artifacts on Android build? 0 Answers

Quadruped robot - articulation body - joints too weak.,Robot controlled by articulation bodies - joints too weak to move 1 Answer

Light gun simulation 2 Answers

RigidBody Physics Flight Simulator Script Help 1 Answer

Basic questions for moon landing game 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges