General breve Programming Questions

Accessing Keyboard and mouse by using Breve

Hi,

I am implementing a simulator. I will need some information.
1) I have a simulator. When it runs I want to pause or stop it by pressing any button by keyboard and after few second or time may be I want to run it again by pressing any button of keyboard.

An idea needs right direction

Okay let me start off by saying that i'll be starting my 4th yr of uni in england. I am studing bsc computer science(SE) .

For my final year projectstarting in sep 08, i am thinking of doing something in AI and graphics .

What i am thinking is creating some sort of simulated world , with 2 creatures . Something

Parallel Universes

I have a question about speeding evaluations of a genetic algorithm up.
GAs can generally take advantage of parallelization if evaluation of each
individual is independent from the others. I'm wondering how to take advantage
of this in breve:

Can I create a multithreaded version of breve code? Perhaps have multiple simulation
worlds running at the same time?

Here's another idea: within the infinite 3D space, I only use a very small portion
of it. What if I simply had multiple self-defined areas of interaction running within

steve emacs mode

Hi emacs users,

Toss the following code into your .emacs for a better-than-nothing emacs mode:


(require 'generic-x)

(defvar steve-indent-size 6
"Amount of spaces per indent in steve-mode")

(define-generic-mode 'steve-mode
'("#")
'("+ to" "if" "else" "iterate" "init" "use" "include" "int" "float" "list" "object" "variables" "Controller" "define" "self" "push" "onto" "string" "vector" "\
new" "return" "foreach" "for" "while" "super" "free" "print" "all" "in" "||" "&&" "==" "=" "<" ">" "<=" ">=" "!=" "+=" "-=" "/=" "*=" "remove" "hash")

the order of iteration

Hi,

I have two versions of some code for a simple robot 'spine'. One encapsulates a UniversalJoint and its controller within my 'jointController' class, the other uses UniversalJoints direct from the spine multibody. Apart from this they are the same. But they have very different behaviours. I can't quite see why this should be so, unless it is something to do with the order of iteration. The desired behaviour only occurs with the encapsulated joint-controllers. But i need to know why this occurs to understand why the behaviour works.

Cheers,

Nick

n/a

n/a

n/a

negative vector literals?

Hi,

I've been experiencing some confusion over how vector literals should be represented in Breve/Push.

I've attached a working/not working simulation which demonstrates the problem but here is the crux of the example problem:

-This works-
self.inter.pushVector(vector(-1,1,1))
self.code.parse('''( SVEL )''')

-This doesn't work-
self.code.parse('''( -1:-1:-1 SVEL )''')

I can push a vector with negative values on to the stack and if I call printStacks, I might get something like this. But if I try to parse the first value from below the simulation freezes.

Push v2 or v3?

Hi,

I've been reading the docs but I can't find anything which says explicitly which version of Push is integrated into Breve.

The config files for Push mention v2 but Lee Spector, on the push site, indicates it uses a C++ implementation of Push v3.

Does Breve use a v3 implementation?

Peter.

Breve, C++ and CUDA

Hi, i just found Breve a few days ago and i think it can be useful for me, but i'm not sure.

I'm developing an "end of course" project which consists in genetic algorithm to optimize the weights of a neural network (also known as evolutionary neural networks). I need problems to solve with my system and Breve could be a nice way to create such problems (the problems would be "realistic" as Breve use a physics motor and the results would be "easy to show" without implementing a GUI, programming openGL or anything like that).

Python?

I have just found out about Breve and would like to do some artificial evolution stuff with it. I'm an experienced Python programmer, so that's the direction I'd like to take.

Breve alternatives

Hello!

I would like to hear about some alternatives for breve, because the development of beve has stopped, it will stay a 32-bit application forever I think and there are many hidden bugs, like slowdown of the whole IDE after longer usage... So what are the alternatives for breve? Is it still used by the author at all?

Greetings,
Pascal

Archiving the Controller

Hey all,

I'm having some difficulty archiving my controller. My controller is being used to run a genetic programming simulation that controls a 6-legged robot. It has a PushInterpreter and a population of PushGPIndividual's. The documentation on archiving simulations left me a bit confused. Do I need to do anything other than create an archive function that returns 1 and save the controller via save-as-xml? When I try that the PushInterpreter errors on archive. Any suggestions?

Thanks

Controlling an additional camera(such as in VisionSwarm).

I've set up breve to simulate the e-puck robot. This is how it looks in its current state:
http://www.youtube.com/watch?v=oywYk7yWdmM

The robot is a MultiBody and two wheels with PolygonDisk shape and sensors as PolygonCode. These are linked together using joints to form the robot. The robot is modified version of the braitenberg robot.

Making a control frame in python with Tkinter

Hello all,
I am working on a simulation where I need to have a control frame running alongside the simulation. I wrote the simulation in pyhton, so I can't use nib files and was wondering if anyone can help me out with some simple code to get a second frame working in breve.

Very simply, this line of code, called in the controller __init__ return the error below

root=tk()

returns

Traceback (most recent call last):
File "/Users/aogden/Workspace/Dropbox/antSim_simp.py", line 288, in ?
myController()

setForce() an getAcceleration()

Hi all,

A few questions.

Why is that Breve returns 0 acceleration in Y direction when setGravity is on (Physical simulation is on too)?

What's the unit of SetForce()? Does it apply acceleration according to setMass()?

What's the unit of Breve's Mass?

Thanks.

coordinate system

Is there anyway to change the coordinate system of breve simulations to a cylindrical coordinate system? this will be of great help in approching many problems.
thanx
Camaro

affix robot to the floor

Hi, I have a robot torso that I want to affix to the floor. You can see a picture at http://www.cs.utexas.edu/users/jmugan/DevelopmentalAgent/

I tried making it really heavy and increasing the friction but it still moves a little bit. I'm sure there is a simple method that I am overlooking. Anyone have any ideas for what that might be?

Thanks,
Jonathan

schedule method-call + while loop

hi
I'm trying to do this:

while r<30:{
self schedule method-call "test" at-time r.
}

and in the method test I increase r, but I don't know why, every time that I run it, breve program show me a message error and close.
What I'm doing wrong? Can anybod help me?
thanks

Did anyone work on get-mouse-x-coordinate??

Hi There,

If anybody don't mind I want to ask a question. Did anyone work with get-mouse-x-cordinate ? When mouse click on the simulation window did it work? If anyone know please let me know.

Thanks,
Jahangir,
Stuttgart University,Germany.

Joint Question

Hi,

I'm trying to make a biped robot based on the walker demo. I've got something that looks relatively bipedal however, the limbs bend out to the creature's sides instead of forward and behind. Can anyone tell me what I'm doing wrong?

I've pasted what I think is the relevant code to http://pastebin.ca/1326302 and also attached the entire file to this post.

Thanks,
Andrew

Regarding get-mouse-x-coordinate and get-mouse-y-coordinate ??

Could anybody please ensure me is get-mouse-x-coordinate and get-mouse-y-coordinate is working in Breve? I have to add little code here as an example. But it is not able to take the simulation window click position(Where in simulation window I clicked on).
+ to click on item (object):
x (float).
y (float).
#if selection: selection hide-neighbor-lines.
#if item: item show-neighbor-lines.

#selection = item.

print " ##################### is mouse click is working ##########".
x = item get-mouse-x-coordinate.

What are the units in velocity?

Hello,

Everything I can find on the site seems to says its units/seconds, but my experience with the programming doesn't seem to agree with that. If I call |(self get-velocity)| with the agents in my environment, I'll get a speed usually somewhere in the 0-2 range, when these agents are actually moving at something like 0-150 units/second.

I'm pretty stuck, and could really use some help if anyone knows the answer.

Thanks,

Pete

Integration / Iteration

Hello...

...to choose the correct settings for the integration and iteration stepsize the documentation says: "For physical simulations, the iteration stepsize should be considerably larger than the integration stepsize."

I want to have precise data so i set the iteration stepsize to 0.0001 and the integration stepsize to 0.00001. Is this "considerably" enough or should i use different values?

Thanks for replies, David.

Sliding Splitter in Code Editor

Welcome,

Good developer attach splitter to Breve script editor, scrolling back and forth is difficult to read. Could make donation for someone who can fork project! Editor has been the biggest challenge managing many files in Breve.

Have a pleasant day.

change resolution of camera

Hi, I have a robot like the one shown at
http://www.cs.utexas.edu/users/jmugan/DevelopmentalAgent/

I would like to get the view of the table from the robot's perspective buy putting the main camera where the robots eyes would be. But when I do this the robot can only see a very small part of the table, presumably because the camera is too close to the table.

Is there a way to widen the viewing area at the possible cost of resolution?

I tried using a Camera object but it doesn't seem to go wide enough.

Thanks,
Jonathan

IS it possible for a new rotatoin method for REAL?

Hello All,

I was wondering if a new method could be added to the REAL object to enable getting rotation around a axis. At the moment all i can see is getting the rotation matrix , is there a possibility that we could have a method like
"int= object get-rotation around (0,1,0)."

This would be a great help for what im trying to achive, Also i thought other users might find it usefull.

capture image for vision processing

Hi,

I want to capture what the robot sees for image processing. The documentation makes it sound easy, but it never says how to do it in a way that I can understand.

I tried this
image = breve.createInstances( breve.Image, 1 )
image.readPixels(0,0)

but this gives me the error
File "/home/jmugan/rcode/robot.py", line 233, in iterate
image.readPixels(0,0)
File "lib/classes/breve/Image.py", line 169, in readPixels
breve.breveInternalFunctionFinder.imageReadPixels( self, self.imageData, x, y )
File "lib/classes/breve/__init__.py", line 144, in __call__

Socket problem

Hi,

I am trying to get sockets working between my Python code and Java. With regular Python files, my test code works, and it works in Breve for sending data to Java.

However, my problem comes when trying to listen for incoming data from within Python code running through Breve. The bind() function works, but recv() just hangs Breve completely. It isn't just stuck waiting for data, it just hangs and I have to kill it.

I tried setblocking(0) but then recv() gives this error:

socket.error: (11, 'Resource temporarily unavailable')

(Though, on the bright side, Breve doesn't hang).