How to program NAO robot in python using the DCM module - nao-robot

I'm working with the NAO robot on generating walkings.
I have used the function angleInterpolation() and it worked well for offline trajectories, but now I need to use the dcm module to send the joints trajectories in real time but when I do it it's like the movement of the joints is very rigid (very different from angleInterpolation). Has anyone worked in NAO robot, specifically with the dcm module that could help me?
I'm programming in python.
(Sorry for my bad English).
I have try using dcm.setAlias() and a time delay to do it.

The movement are more rigid because angleInterpolation() generate splines, while dcm handle direct position (=>linear). If it's what you need, you need to modify your order to damp start and stop.
Btw working with dcm is more dangerous, as there's less protections. Another alternative is using ALMotion.setAngles functions family.

Related

Implementing a simple code in Microsemis Soft Console

I would like to get into the field of FPGAs a bit. I currently have a PolarFire Everest Dev Board and would like to try something small on it for testing purposes. My current level is very low, i.e. complete beginner. My first working project was a counter that counts binary to 15 and outputs it via the LEDs of the board. Now I wanted to play with RISC-V. Unfortunately I can't find anything on the internet that meets my expectations and almost nothing is "beginner friendly". My current goal is actually just to implement something on the level of a Hello World program in C via the SoftConsole. Unfortunately I have no idea how to go about it. Can anyone help me or recommend a good entry on the internet? Most of the stuff is either unusable, requires licenses I can't get, or is simply no longer available (which happens to me quite often with PDFs from Microsemi).
Since I don't really know what I could do with it to start with, I don't have any code yet that I would like to include. The plan would actually be to create something where I also get feedback via the board that something has been done. Later when I have more understanding SRAMs should be managed with it.

Load a PNG image from a USB stick with stb_image

I'm asking here because the documentation concerning the aforementioned library is horribly lacking. As written in the title, I want to load a PNG image from a USB stick and then decode it using stb_image but I don't know how to go about it.
To add a bit of context, I'm using a discovery board from ST, the STM32F769I and running FreeRTOS.
I thought first that simply calling "stbi_load" with the full path ("0:MYIMAGE.PNG") would suffice but it doesn't.
Therefore, I suppose another function must be used for that purpose but which one ? stbi_load_from_memory ? I don't have it very clear. Or should I first call a FatFS function like f_open() before being able to call any decoding function?
Any help is more than appreciated. It'd be very helpful if you could write here a simple example that does the job.
Thanks in advance.

Simple graphics library for tick-based simulation

I am creating a tick-based simulation in C, currently running on Mac OS X 10.8.4.
At the moment after each tick, I am printing out the entire world representing in ASCII to the terminal, using ANSI escape codes to move the cursor to the correct place.
I would like to transition to a graphical based representation of the world instead of using the terminal window. What would be a good library use? Also, what is the accepted way of performing multiple updates to the screen per second in this library?
I would use SDL since it is cross compatible with most OS and mature.
Also check these examples for 2D animations in order to perform the screen updates you need.

how to add controls for a game using batch files?

I am attempting to make a platform game using batch files. I know this seems like a waste of time and there are better tools out there but I just wanted try it out. How do you set up controls so my character moves, jump, gravity and collision? Here's a link to a vid that shows a platform game made in batch file: http://www.youtube.com/watch?v=O_Egqa0Gqhc
You could start with reading Batch Minesweeper and pacman to learn a bit about batch gaming.
But to handle the arrow keys you need always an external program, as choice can't handle them.
With choice you could use "normal" letters, so you could use ASDW to move instead of the arrow keys, but choice is not available in XP.
And you should know how to start and communicate between multiple batch processes.
What you can do is try useing the bscript engine that way you will already the stuff that you need to make ur game but, consider the manual is extreme not like hugh extreme ment a bit confusing and take time to settle . Considering theyre trying to make the engine very fliud in batch script which is hugh lol

Display pixel on screen in C

How would I change a pixel on a display, in C?
Assume NOTHING: I am using a linux machine from console to do this. I do not want to use GUI toolkits or frameworks to draw the pixel. I do not want to draw the pixel in a window. I want to draw the pixel directly to the screen.
EDIT: I have a screen. I'm on a laptop running linux from console. I'd prefer a solution not using X as I'd rather learn how X works than how to use X.
If theres more information, ask, but don't assume. I'm not trying to build a GUI, and that was the main purpose of blocking assumptions as I don't want people to assume I'm doing things the long way when in reality I'm just tinkering.
EDIT 2: You may use any X11 related libraries provided that you can explain how they work.
If we really assume nothing, can we even assume that X is running? For that matter, can we even assume that there is a video card? Perhaps Linux is running headless and we're accessing it over a serial console.
If we are allowed to assume a few things, let's assume that Linux has booted with framebuffer support. (It's been a couple years since I worked with Linux framebuffers, I may get some of the details wrong.) There will be a device created, probably /dev/fb or /dev/fb0. Open that file and start writing RGB values at an offset, and the screen will change, pretty much regardless of anything: text console, graphical console, full-fledged desktop envrionment, etc. If you want to see if framebuffer support is working, do dd if=/dev/zero of=/dev/fb on the command line, and the display should go all black.
C doesnt have any graphics capabilities - you'd need to use a third party library for this.
You cannot assume a display in C. There is literally no way to do what you ask.
Edit: Okay, you have a display, but again, there's not a whole lot you can get from there. The point is that there are a TON of competing standards for graphics displays, and while some of them (VGA interfaces, for example) are standardized, a lot of the others (display driver interfaces, for example) are NOT. Much of what X (and other display device drivers, such as Windows or the like) do, is have specific interface code for how to talk to the display drivers; they abstract out the complexity of dealing with the display drivers. The windowing systems, though, have HUGE libraries of complicated and specific code for dealing with the display drivers; the fact that these things are relatively transparent is an indication of just how much work they've put into these things over time.
Very primitive and making a lot of assumptions:
fd = open("/dev/fb0", O_RDWR);
lseek(fd, 640*y+x, SEEK_SET);
write(fd, "\377\377\377\377", 4);
In reality, you would use mmap rather than write, and use the appropriate ioctl to query the screen mode rather than assuming 640xHHH 32bpp. There are also endian issues, etc.
So in real reality, you might use some sort of library code that handles this kind of thing for you.
I suppose you could paint to the terminal program that you are using as your console. All you have to do is figure out which one that is and look it up.
Whoops I assumed a terminal. :P
I think what you are looking for is information on how to write to the frame buffer. The easiest way would be to use SDL and render to the frame buffer, or else use GTK+ with DirectFB, although that goes against your edict on not using toolkits or frameworks.

Resources