Jump to content

Charrua

Developers
  • Posts

    230
  • Joined

  • Last visited

Everything posted by Charrua

  1. Charrua

    Basic GUI Creation

    thank's, i have been doing some trials... without much success trying to get events and objetcts from cpp created lua side... i will read and try what you posted here... and but... no one answer... seems to be a black hole on this topic hope your blog bring to me some light at the end of the tunnel Juan
  2. Omg, should I switch links.. https://drive.google.com/file/d/1rD2J0IMv8yju-4eIAve84Sp2Rz0XF9Bl/view?usp=drivesdk Hope not this time sorry, i did it again... here is the correct installer: https://drive.google.com/open?id=1rD2J0IMv8yju-4eIAve84Sp2Rz0XF9Bl Thanks
  3. so far, so long... time to do an update a video showing the bot finding the way out of a maze.. https://youtu.be/-sOQDLpiigQ for this algorithm to work, the ultrasonic sensor and the linefollower sensor were re-positioned, thing that is easily done using the gui, as loading a new floor and/or maze. another simple test of the on-board led's the installer: https://drive.google.com/open?id=1rD2J0IMv8yju-4eIAve84Sp2Rz0XF9Bl the new look: kind regards Juan
  4. gui seems to stop working if I press scape, menu appears but do not react to mosue clicks.. (testing only a lua project) some other old joints/vehicle scripts of mine seems to not work as it did also :(, guess i have to wait some time
  5. Charrua

    Forklift truck

    Hi Yue, nice to see you arround , very good models, congrats! You may use a slider joint to move up and down the lift part, i used them somewhat when doing some tests: I also use blitz3d some years ago with ODE, my art skill is 0, just cubes but here you may see what I've done: https://sites.google.com/site/odriozolajuanignacio/juanodriozola/blitz3d (Utility cars is at the bottom of the page) And here with Leadwerks: and some videos showing it in action As a starting point you may look at "SlidingDoor.lua" in "Scripts\Objects\Doors" to see an example of a sliding joint If you need some help, ask or PM me, in that case you know, you can use Spanish But I do like, if possible, continue here, just in case, it would be helpful for some one else here. Juan
  6. I received a renew some days earlier, supposed i'll be informed of a new debit, but instead i have to re do the payment, no problem at all.
  7. As the documentation is in Spanish… English will come soon, but mine is very elemental in the zip file will find: mBot folder: the executable vcredist_x86.exe if needed a couple of sb2 scripts: line follower and obstacle avoidance vspe: virtual serial port emulator, optional, if you need it to link scratch with the simulator (another way of linking the simulator with scratch is using a couple of FTDI modules wired one with each other Here is some basic explanation In the mBot folder you will find a couple of sub-folders called “pisos” and “laberintos” : floors and mazes. Any jpg image of 512x512 pixels can be added to the “pisos” folder and used as a mat on the 3D scene of the simulator, some examples are inside the folder for you to use. The mat will have 4m x 4m so one pixel is about 0.78 cm, i recommend the use of at least 4 pixels thick lines if you plan to build a track for the mBot to follow. In the “laberitnos” folder, there are text files with a elemental draw of the walls of the mazes: 40x40 characters each non “space” character will build a cube of 10x10x10 centimeters so a 4m x 4m maze could be built. About the first 3 lines of the text file they must contain 3 numbers, one on each first line: x position in the range 1 .. 40 column in the maze where mBot will start positioned second line, y position in the range 1 .. 40 line in the maze where mBot will start positioned third starting forward angle of mBot, 0=North (?), heading away from us, 90 means going right, 180 approaching us, 270 going to the left. Any integer from 1 to 359 may be written. If you do not link scratch with my simulator, you may select “continuar” in the first screen and use some keys to move the mBot manually and to move the camera which always look to the mBot. Keys A/Z will increase/decrease Left motor speed by 25, Up/Down arrow does the same with the Right motor Space will stop both motors Left arrow will give 50 of speed to both motors and right arrow -50 (reverse) to both motors With keypad keys you can control the camera position 5 move camera to default position 30 cm above and 40 cm behind 4,6 turn camera position clockwise/counter clockwise 8,2 rise/lower the camera 7,9 zoom in, out to reach the first screen (3 options menu) you have to press ESCAPE key if you select “Config” to select a floor and/or a maze, one, other or both and some other options like kind of power 6V, 3.7V, serial communication port, some optionally texts on screen like motors speed, line followers state, ultrasonic sensor reading… On the “Escenarios” Tab, you will have a couple of list boxes with the files on the “pisos” and “laberintos” folders, the included ones and the ones you create “pantalla” tab will let you choose screen resolution, I recommend some half width resolution so if you hide the “scene” on scratch you may have scratch and mBot simulator side by side. enjoy Juan
  8. Hi this is the first release of my mBot simulator https://www.dropbox.com/s/yoao21cieviitun/emulador mBot.zip?dl=0 documentation is in spanish https://www.dropbox.com/s/9z5wtvrfa17tt3o/guía de usuario.pdf?dl=0 in the zip file there is a folder "mBot" with the executable and a couple of subfolders "pisos" : floors "laberintos" : mazes in which some .jpg for floors and text files for defining mazes can be added to the sample ones. also there is the vcredist_x86.exe and an aplication VSPE to emulate pairs of serial ports to link the simulator with the mBot scratch sofware, and a couple of .sb2 (scratch scripts files) to test the scratch-simulator behavior. would be good to me to know if someone can execute the exe file and with what issues if any and in which platform if possible and if you have some experience with mBot and the simulator is of any interest, better! play with it enjoy Juan
  9. i made this tri-wheel vehicle some years ago... with hinges and a couple of lua scripts i know that vehicle is much nice than this... but is another option, here a tri and a quad wheel hinge made vehicles last month i revised and tested again those scrips on my mBot simulator and still works correctly https://www.leadwerks.com/community/topic/16695-mbot-simulator/ Juan
  10. I used PayPal, no problem at all Order #21 that's mine keep the good work!
  11. Spanish ÁáÉéÍíÓóÚúüÑñ
  12. LE 5 will be windows and linux or windows only? Will it has 2 versions, i mean Lua only and PRO: C++ and Lua?
  13. now I started to add some user interface, to select a maze and/or a texture for the floor and some mBot related parameters. I'm using a text file to define maze walls, following some screen shots and the text file which defines the maze:
  14. The mBot software communicates with the real hardware through a serial connection, on the other side instead of the mBot hardware (which is an arduino running a sketch) is my software receiving commands and reporting sensor status as commanded. That´s the real mBot After some changes, the way the robot looks mostly, some explanations and a couple of small programs in scratch and the way them plays on the simulator. Sorry about my version of mBot, I´m obviously not an artist. Line follower sensors are quite a simple device, just a light source and a light sensible sensor that measures the reflected light by the floor, those sensors are calibrated to give only 2 values 1 or 0 if the floor is white or black and, normally a path in black is traced on the floor to follow... The leadwerks way of making a line follower senor is somewhat more complicated: A spot light and a camera. The spot light is needed because the shadow of the environment and/or the mBot it self causes to see shadows as black floor... the camera is rendering to a texture, which i set to the small cubes just to watch what the camera sees, it looks good and gives real time visual feedback. I get the pixels of the texture and average the amount of light received and compares it to a threshold of 1/2 the full range. For the ultrasonic sensor i use a pivot 4 meters ahead of the mBot body just because normally is the usable range of this kind of sensors, each frame i do a world:pick to know if there is something in front of the robot. Following a scratch code for line following and the corresponding simulation. And a simple object avoidance program and it´s behavior on the simulator Juan
  15. at this stage... really don't know there are some things that are so easy of simulate, like the ir sensor, it's just a matter of map keyboard keys and send them to scratch when asked about the ir receiver, and there are other that should be more difficult to emulate. my first goals are basic functions, some set of mazes/tracks and any easy to implement function. At first making a led display and this things sounds to me not so much useful but not so hard to implement. I use de pro version and the serial communication is made cpp side, and any lua simple thing is made in lua
  16. Hardware has this kind of issues, and in the other hand this is what make it lovely but, you got the point. It's true that most of the time software do not run at first try, but the errors are always between the keyboard and the monitor... Hardware has the plus of some connection and or other not depending on us matter that makes we get wrong deductions about the bug we have. With a software tested in a simulator, we get a step accomplished, so if it do not work is a hardware related thing, and in the mean time, we enjoyed programming.
  17. Hi I'm starting a mBot simulator ( http://store.makeblock.com/product/mbot-robot-kit ) mBot is an arduino based robot-car programmed in a scratch environment for educational purposes. The thing is that in a classroom normally there are more students than robot's and a simulator should be handy in the mean time a real robot gets free for playing. By now I implemented the communications protocol between the Scratch IDE and the Simulator. Connection is made via a Software Virtual Port Pair emulator, because, the IDE connects to the robot via a serial port, and sends commands and receives sensed data form the robot via this way. For starting I implemented a sub set of commands: Move motors, ultrasonic sensor (for distance to walls measurement: obstacle avoidance) and Line followers (yes.. for the same purpose :). Firsts test are ok. Here a couple of videos, first having both programs interconnected, running a simple program in scratch and seen the robot act as commanded. Program is so simple, move forward, move backward, turn right, turn left.. Second video shows the same program running on a real robot, not the mBot, just one i made compatible with it. just another real hardware test For the ultrasonic sensor I'm using world->Pick and for the line followers sensor I'm using a couple of cameras which renders to a texture, then i average the light seen getting the pixels of the texture and simply averaging them. Next steps will be, testing a obstacle avoidance and line follower automatic motion program, with the simulator and real hardware. Simulator has to match as much as possible the real hardware so still much to do on metrics. Her a couple of snap shoots: Juan
  18. is there a way to find the color of the picked surface after a world::pick or similar? i guess that should be doing some maths with u,v coords and the relative position of the pick with respect to the triangle vertex... but i can not figure it out.. , or there is a simple and obvious way of doing it. thanks in advance Juan
  19. Hi Yes, you can access any entity created on a map looping on the world entities collection see: Juan
  20. I started another thread (https://www.leadwerks.com/community/topic/16553-handling-widgets-created-cpp-side-and-lua-side/) because i started with a gui in lua and then has the need to create and handle some widgets in cpp code, i had some troubles and guessed that the problem was in a bad parameter usage/passage. So I decided to make it work only in cpp code and i found that the test (event->source == butt1) never gets true, the same problem that i have when calling a method from lua passing the event peeked from the queue. Relevant parts of my code: /* globals */ GUI* gui; Widget* butt1; /* in App::Start */ gui = Leadwerks::GUI::Create(context); butt1->Button("Quit",30,30,100,50,gui->GetBase()); /* function to process events */ bool App::ProcessEvent(Event* event){ if (event->id == Event::WidgetAction) { System::Print("widget action!"); if (event->source == butt1) { System::Print("butt1 pressed"); butt1->Hide(); return false; //quit } } return true; } inside App::Loop while (EventQueue::Peek()){ System::Print("event queue peek"); Event event = EventQueue::Wait(); if (ProcessEvent(&event)==false) return false; } what am I doing wrong? thanks in advance Juan
  21. thanks for sharing this beauty It remembers me an old technique of making shadows.. by creating a black+alpha mesh that overlaps the terrain/buildings with a small offset, when almost all thing were made by hand!
  22. Hi I have some widgets created and handled on lua scripts Now i need to create some widgets cpp side, and, as far as i know, there is one eventQueue so only one loop to peek events should exists, isn't it? I do that loop, on a lua scrpt and i have exposed a class with tolua with only one method: void ProcessEvent(Event event) and when a piked event.source do not match any widget created by lua scripts then, the ProcessEvent in lua calls it's counterpart ProcessEvent method and pass the event to it. When i push a button created by cpp, then the ProcessEvent method is invoked (that's ok and nice!) but the test if (event.source == myCppCreatedButton) never gets true i can and do use, event.id for example, so not all is wrong.. i guess that perhaps i'm missing something obvious, casting perhaps? any idea? by the way, any idea of doing the same thing better? or I did take a complicated solution being one easier? thanks in advance Juan
  23. thank's for your time and generator yesterday i wrote a very simple class to start doing some tests and found that there is a generator for windows and as i have to write th .pkg by hand (for a simple test class is not so much work) i just be curios about the same tool for linux. if I get it to work, in case i use it i'll will update here or on your thread, but, you know, if i already make it work by hand... and my class will not be so much complicated... chances are that i let it as is for a while thank's again Juan
  24. is there a similar tool for linux?
  25. he, he, i edit the code blocks, they were unindented, and i hate this! also i noticed that my public dropbox folder isn't public any more.. that's weird.. the project posted and other things all over other posts are not available any more will have to fix this
×
×
  • Create New...