LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Online rotate a xy graph around the zero point

Solved!
Go to solution

Hi,

 

I want to plot the path of my robot by instaling a bluetooth mouse on it, so when the robot moves, the mouse cursor changes and I can plot the path in labview.

 

 

My problem is that while rotating the robot, mouse is rotate too but the cursor is still on the staigth way. my question is that how can I rotate the xy graph online so that i can plot the path by this trick.

 

thank you

mohammad

 

 

0 Kudos
Message 1 of 8
(3,310 Views)

Can you make an illustration of what you want?

0 Kudos
Message 2 of 8
(3,301 Views)
Using a Bluetooth mouse for sensing motion... I like it. Very cool solution.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(3,245 Views)
Solution
Accepted by topic author mikhay

Movement on a 2D plane (I'm assuming your robot is rolling around on the ground) takes three parameters to specify location and orientation, X, Y, and Heading.  Most mice are designed to give you X and Y, assuming that you maintain a constant heading.  I just tried turning my Logitech mouse, and noticed X and Y moved a lot -- that's because the sensor is eccentric in the mouse, so the rotation got "mapped" into X and Y, but not heading.

 

You can solve this by using two mice and "doing the math" (may take some experimentation to get the proper constants) to map rotation into mice outputs.  Note that choosing the origin of your robot coordinate system (relative to the "origins" of the mice) is also important.

 

Finally, the plot you want to make is probably not a "moving cursor" (since I don't know an easy way to make a cursor rotate) but a simple representation of your robot moving around on the screen.  Christian Altenbach recently answered a "math problem" Jeff Bohrer posted where he created such a display (maybe a week ago) -- give him credit for the design if you "borrow" it.

 

Bob Schor

0 Kudos
Message 4 of 8
(3,230 Views)

When you rotate your robot, how do you know how far it has turned or what its new heading is? You will obviously need this data to replot the graph.

 

Given the heading, it should not be difficult to calculate the new movement by taking your XY data from the mouse and a little simple trigonometry. In fact, you shouldn't need to rotate the graph, just calculate the correct position based on mouse data and heading.

0 Kudos
Message 5 of 8
(3,203 Views)

Look at chip driver and doc of the sensor. My opto mouse will compensate a rotation due to hand rotation on a continous move 🙂 

So the rotation information seems to captured and transmitted. 

There are many mouse sensor hacks documented in the www.....

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 8
(3,173 Views)

Simply I want to sense the rotation of robot while the the mouse is rotating too. But if the robot (and the mouse that is fixed on it) turn left (or right) the graph is still showing that the robot is moving straigth. My Idea is to rotate the graph in order to sensing the rotation.

 

thank you for you attention

Mohammad 

0 Kudos
Message 7 of 8
(3,150 Views)

thank you very much. You answer is so excellent. I can do some mathematicla work on your idea and solve my problem.

 

thank you for attention

Mohammad

0 Kudos
Message 8 of 8
(3,147 Views)