Want to build vision sensor

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Want to build vision sensor

Postby easysim » Sun Jun 07, 2009 12:54 am

Hello forum,

I am a beginner with the Newton Game Dynamics and just finished with the tutorials.

In my program I want to simulate a robot and a vision sensor. The vision sensor should see the environment that would be for example boxes and walls.
From the tutorial I think I have understand that the normal collision detection should simply work with Newton (robot drives into wall and stops,...)
Now I am wondering what is the best (fastest) solution for the vision sensor.

I believe I could use NewtonWorldRayCast() to simulate the sensor, but the sensor should have a wide vision field (30-90 degrees) like so:
simulation1.jpg
sensor
simulation1.jpg (31.01 KiB) Viewed 2822 times

For this I need to make many calls to NewtonWorldRayCast() (for example every degree between 0-90) and still I could miss objects in the distance which far apart.

There must be a better way? Like a triangle that simulates the sensor vision region, that can pass through all objects, but I can still use Newton and callbacks to let me know when collisions appear? I mean I do not want the triangle to move the other objects in the simulator.

It would be nice if there is somebody that could give me a tip into the right direction!

And thank you for Newton Game Dynamics. I have started just few days ago but I already like it's simple usage :)

dave
Last edited by easysim on Tue Jun 09, 2009 1:59 am, edited 1 time in total.
easysim
 
Posts: 7
Joined: Sun Jun 07, 2009 12:12 am

Re: Wanting to build vision sensor

Postby JernejL » Sun Jun 07, 2009 8:36 am

There is a feature called "convex cast" in newton 2.0, which can cast a convex shape into some direction for specified distance and return back all the hits.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Want to build vision sensor

Postby easysim » Tue Jun 09, 2009 2:01 am

Thank you!
This looks exactly like what I would need.

I've downloaded the latest beta SDK and I can see the function in the header file.
The documentation in the SDK is possibly not updated for 2.0 by now, could you also show me where to get documentation for the new function?
I looked in the Wiki but it was not there either.


dave
easysim
 
Posts: 7
Joined: Sun Jun 07, 2009 12:12 am

Re: Want to build vision sensor

Postby JernejL » Tue Jun 09, 2009 4:06 am

All of the documentation was not yet updated, but there should be a convex cast example in demos.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Want to build vision sensor

Postby easysim » Tue Jun 09, 2009 4:32 pm

Thanks. I will check the demos.
I didn't notice there were new ones in SDK 2.0 because I cannot compile the Mac SDK 2 Beta on Mac OS X 10.5 with Xcode. I will try again!
easysim
 
Posts: 7
Joined: Sun Jun 07, 2009 12:12 am

Re: Want to build vision sensor

Postby Julio Jerez » Tue Jun 09, 2009 6:18 pm

What problem are you having with teh Mac Build.
the new 2.01 build sodul buil out of the package.

you may need to intall some system Packages like GLUT, GLEW and GLUI
The SDK demos are buidl uning OS 10.5 bu teh engien libraryes are made using OS 10.4
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Want to build vision sensor

Postby easysim » Wed Jun 10, 2009 1:18 am

All build errors I can see are caused by GLEW and by GLUI, but I can not find them in standard frameworks directory.
Is this a third party library? Need to search with Google..

dave
easysim
 
Posts: 7
Joined: Sun Jun 07, 2009 12:12 am

Re: Want to build vision sensor

Postby Julio Jerez » Wed Jun 10, 2009 10:17 am

I think the GLEW and GLUI you can browse the net there are some people who distribute Framewrok that you just need to install.

I guess that next time I can add then as part of teh SDK, and build then rather than us the framework
I was trying to do that teh oteh day when I have big problems building the SDK for OS 10.4

anyway searh in teh net for ths framework, I will see what I can do to make them part of the SDK next time.
I did that for tinyxml, so it sodul be trivial for teh graphics too.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests