ImageProcessingExample Scene

Typically: "How do I... ", "How can I... " questions
Post Reply
Pikapi
Posts: 14
Joined: 31 Jul 2013, 09:26

ImageProcessingExample Scene

Post by Pikapi » 03 Aug 2013, 20:35

Hi, in the child script associated with hexapod, there is some parameters/arguments which haven't been declare such as rotation, direction and forwareVel. May i know where is the rotation, direction and forwardVel come from? Thanks.

coppelia
Site Admin
Posts: 7024
Joined: 14 Dec 2012, 00:25

Re: ImageProcessingExample Scene

Post by coppelia » 05 Aug 2013, 10:40

Hello,

The demo model hexapod2 uses a non-threaded child script as the main controller. It is meant just as a simple example, and one could imagine many different control algorithms. rotation, direction and forwardVel are modified depending on the simulation time as can be seen here:

Code: Select all

cnt=cnt+simGetSimulationTimeStep()
if (cnt>10) then
	if (direction<math.pi*2) then
		direction=direction+0.02/st
	end
end
if (cnt>35)and(cnt<55) then
	rotation=-0.5
else
	rotation=0
end
It is not a very elegant solution though ;)

Make sure to also have a look at the demo model hexapod1, which is probably a little bit easier to understand, and which uses a threaded child script as a main controller.

Cheers

Post Reply