copy(src, sx, sy, sw, sh, dx, dy, dw, dh)
But the result should end up in an PImage, not on the screen.
Thanks lot Robert
Hi,
I try to rotate a shape. The shape is a rect which is supposed to stay in the middle of the 500x500 (second window with map) screen.
It should turn to "theta" (variable submitted from my robot).
But when it rotates, it significantly moves away from the center.
What do I do wrong?
My code:
Thanks
Robert
Hi,
I use processing for visualizing sensor readings of my robot. The sensors are not at the center of the robot. So I need to add some shift/offset to the readings.
I have X,Y and theta of the robot. I know the offset of the sensors from the center of the robot.
--> Is there a simple formula to calculate the X/Y position of the sensor based on the current robot position and heading?
I could of cause do something like “90 degree right + X offset -> 90 degree left + Y offset”. But this would require quite some calculations per sensor data point.
There must be a simpler mathematical solution.
Thanks
Robert
Hi,
I am building a program for steering my robot and mapping the environment.
My question is about drawing and storing the map.
What I want:
My approach would be to create a 1000x1000 byte array (store not scanned, clear, blocked).
If I want to rotate the map, I need to recalculate position of each pixel.
If I zoom I read only a smaller portion of the array and draw dots with arrayvalue*zoom in size.
I store the map in a csv (all array values). I could also store only scanned points. But as I would need store position, the amount of date would be equal or even more.
Is this the best or at least a good approach? Does someone has tips or a demo project?
Thanks
Robert
Hi,
I am trying to display an image I receive via serial. I submit different color depths.
The code is below reacts on:
g_grayscaleImage == 0 // 16 bit rgb
g_grayscaleImage == 1 // 8 bit grayscale
g_grayscaleImage == 2 // 4 bit grayscale
The code works fine for 16 and 8 bit. With 4 bit I don’t get the pixels to the right position. (so the part from "else if (g_grayscaleImage==2)" doesn't work)
The “best” result I got with the code below. It looks like this:
http://www3.picturepush.com/photo/a/11925461/img/11925461.jpg
Does someone see the mistake and can help me out?
Here the code:
Thanks
Robert