Virtual Arduino - (virtual.logic tab is simply a Python service running emulation logic) - Aren't virtual pins cool !  We have analog & digitial now

We now have the tab with the correct version of MRLComm for that release - a good thing

 

oops

 

Progress thanks to Gareth ..   cause and effect .. effect needs some work ;)

 

Thanks Sir Gareth Master Blender-Fu Sensei !

Gareth has rigged more joints WOOHOO !.. and shifted all rotational values to the local X axis Yay !
Now I got to map all this so a regualr InMoov script does not drive him to contortions and release virtual smoke !  Tried some of the common big scripts but I see I have to start with small pieces.....

 

Ouch I borked my neck ! ... Elves are trying to glue Gareth's rigging to MRL ...  needless to say, "Needs some work!"

The MRL Blender service is going pretty well - this is an example of a control script...

https://github.com/MyRobotLab/pyrobotlab/blob/master/home/GroG/BlenderVirtualInMoovControl.py

There is very little "special" coding needed to switch InMoov from virtual to real and back again, which is a design goal.

 

2015.04.05

Another thing coming out in Release 108 will be Virtual InMoov ..  Now that all the Serial and Arduino services have  been fixed in such a way so that they support virtual ports.  

Virtual ports are serial ports over internal queues or tcp/ip connections - so serial "wires" now stretch internally to virtual devices.

The picture is Gareth master rigging in Blender - with 2 virtual Arduinos and quite a few servos attached.  Some mapping will be needed to correct angles, that's why the head has moved into the back :P.  Also, the master rigger might be so kind as locally re-orient the bones so they follow the same axis as the servos (always on x).  


Here is the resulting report from auto-test in the build script - next would be to post this automatically from Travis-CI after ever build....

Many sensors :) ... Virtual Python now is sending data back on multiple analog lines - was very interesting when I started starting a bunch of other applications on my computer I had the pleasure of watching buffer overruns happen, and then the whole graph go crazy ! - with a buffer overrun the codecs begin exploding and the graph looks like spagetti ! :)  But for the most part - its pretty solid with 5 Analog lines running simultaneously - probably runs faster than real hardware ... lots more testing to do 

 

2015.03.27:15:22  LOOK AT MY "PERFECT" SENSOR !!! 

Its sending back Virtual sensors are starting to work well. The Python Virtual Arduino is now multi-threaded, and here I'm testing one of the analog pins. Interestingly the data rate is very similar to the data rate I get with real hardware ... hmmm.....

2015.03.27:15:22


Better now ..  saw where a reference to a Pin was being used on 2 different threads - explains most of the weirdness..  Here we have a regular sawtooth - which is what I'd expect .. still have some buffer overruns which cause the graph to get wonky - but the rate at which Python can send out data is probably much higher than a 57k Bps serial port can handle...

 


This is a review of up-coming functionality in Release 108.  Here is a list of the large changes in 108.

  • Arduino service now uses the Serial service for all serial communication (as do all other services) - Important architectual changes as all serial fixes, enhancments, or improvements are done in only 1 place (duplicate code is bad)
  • Serial service improved greatly.  Serial service can open all sorts of different ports. It has the ability to open regular hardware COM ports, TCP/IP, and virtual ports.
  • Robust virtual ports - previously virtual ports were "kludged" together.  Now VirtualPorts are well defined software constructs which can be used in automated testing.
  • Automated testing - all tests will be moved into JUnit and a rigorous set of service tests will be continually developed as MRL grows.  This is the only way that such a small group can create and maintain a large and expanding code base.
  • Refactored Serial Libraries - MRL's serial library was a bit of a mess - its all been refactored and the common unit for all serial communication is a Port
  • RXTXLib "normalized" - rxtxlib does not conform to Java's standards - but this out-of-spec is fixed in a sublcass and all Ports conform to the standard.

Nice Python errors published to gui

https://lh6.googleusercontent.com/62ZYiXPfyKVu04gBzAOvqEH2UC0g-hnTvbFjpS5jIQrhia9CxnrXBbh_EmjYT-IyVclvgvxZvZk25rg=w1896-h869

 

Virtual Arduino - a pre-configured Virtual Device

Easy virtual Arduino testing

vport = "VPORT"
arduino = Runtime.start("arduino", "Arduino")
virtual = Runtime.start("virtual", "VirtualDevice")
virtual.createVirtualArduino(vport)
arduino.connect(vport)

at the core of the virtual device is another Python service so you can create any bizarre hardware abmnormalities you may want to simulate !  Uh, this one is coming from my Arduino.py script which emulates how a "real" hardware Arduino would be have when asked to start polling on an analog pin .. 

Uh .. but there's a glitch somewhere - I was expecting a FLAT LINE !! .. What?!?!? how is this possible .. probably a virtual short circuit :)

wvantoorn

9 years 8 months ago

Grog, is it possible to use filters in the oscope, to make it like a logic analyzer? If it can be used to amplify signals, or the opposide, it would be great, so it could even be like a real oscope!

 

Gareth

9 years 7 months ago

Thats looking very close GroG.

What I see is left arm is "backwards"

most other joints in motion are 90° out of phase almost like the end motion of the joint.

I would like  to see this picture with all joints set to 90°, as I think a lot are (errr) joints are centered at this value.

I will try to get my bridge working asap and see I can iron out a few plus's and minus's in the direction of movement.

The other good news is you may have contorted VinMoov, however all its joints stayed connected.....so the bolts are tight... \é/

GroG

9 years 7 months ago

In reply to by Gareth

Ya your virtual glue is holding well  !

This is what inmoov looks like "at rest"

i01.rest() is not all (in fact few) are at 90 degrees - but its at rest according to Gael's original ...
MRL's servos have the ability to "map" so I can start mapping scalars to start getting things aligned 
The neck is a little problematic .. its one of the servos which is supposed to be at 90 degrees but when I hit 90 it does a flip ... 

 

awesome!  I was able to fire up blender & the blender service.. I saw the motion ...

The rigging/ bones have some need for updates, but this is pretty awesome, cause & effect..  move slider,, arm moves..  

Great Work!  It's getting there.