Inmoov Conversion

 
#141

@mayaway, Nice work on that neck, it moves pretty good. I know a few Inmoov builders are using that design. I know you have a plan for tracking with 3 servos because EZ Builder only can control 2 servos for tracking purposes, can you post your ideas?
Also, You should start a separate thread with your ideas, designs and progress you are making on getting your InMoov to walk. I know a lot of people would be interested in it.

#142

@bhouston Thanks Bob! I may not need to pursue my plan as Drupp's code (posted below) from the EZ app store 'New Neck for Inmoov' may do the trick. At a glance it looks like he uses the eyes to track, keeps track of the neck servo positions, and nudges (within tested limits) the head to follow the eyes. If the tracked object goes out of range everything is returned to center. Pretty clever! Drupp's code: (you can load his EZB file and look everything over.)

Code:

 
# Script will move Eyes, Head & Torso to follow color, object, Face, ect
# Camera drives the Eyes Horizontaly & Verticaly.
# Tracking is enable

# D20 Eyes Vertical Servo
# D21 Eyes Horizontal Servo
# D0 / D1 / D2 Head Servo Blue / white / xparent
# 1.D23 Torso Servo (not enable yet)

ServoSpeed( D0, 2 ) # Head Speed
ServoSpeed( D1, 2 )
ServoSpeed( D2, 2 )

waitforchange($CameraIsTracking =1)

:Follow # Loop

if ($CameraHorizontalQuadrant = "Right" and $CameraIsTracking = 1)
# If the eyes are tracking to the right
# Head will follow the eyes turning to the right
# as long as the object, color, etc is detected
ServoUp( D0, 3)
ServoUp( D1, 3)
ServoUp( D2, 3)
ServoUp( 1.D21, 6 )
ServoUp( 1.D22, 6 )

$HeadPos_bleue = GetServo( D0 )
$HeadPos_blanc = GetServo( D1 )
$HeadPos_Xparent = GetServo( D2 )

# {@mayaway = you may need to adjust these numbers for your build...}
if (($HeadPos_bleue > 140) AND ($HeadPos_blanc > 180) AND ($HeadPos_Xparent > 171))
# neck servo movement limitation
Goto (center) # reposition head in center
endif
endif

if ($CameraHorizontalQuadrant = "Left" and $CameraIsTracking = 1)
# If the eyes are tracking to the left
# Head will follow the eyes turning to the left
# as long as the object, color, etc is detected
Servodown( D0,3)
Servodown( D1,3)
Servodown( D2,3)
ServoDown( 1.D21, 6 )
ServoDown( 1.D22, 6 )

$HeadPos_bleue = GetServo( D0 )
$HeadPos_blanc = GetServo( D1 )
$HeadPos_Xparent = GetServo( D2 )

# {@mayaway = you may need to adjust these numbers for your build...}
if (($HeadPos_bleue < 40) AND ($HeadPos_blanc < 73) AND ($HeadPos_Xparent < 61))
# neck servo movement limitation
goto (center)
endif
endif

if ($CameraHorizontalQuadrant= "Middle" AND $CameraVerticalQuadrant = "Top" and $CameraIsTracking = 1)
# If the eyes are tracking to the top
# Head will follow the eyes turning up
# as long as the object, color, etc is detected
servodown(D0,3)
servoup( D1,3)
servoup( D2,1)

$HeadPos_bleue = GetServo( D0 )
$HeadPos_blanc = GetServo( D1 )
$HeadPos_Xparent = GetServo( D2 )

# {@mayaway = you may need to adjust these numbers for your build...}
if (($HeadPos_bleue < 40) AND ($HeadPos_blanc > 143)AND ($HeadPos_Xparent > 120))
goto (center) # neck servo movement limitation
endif
endif

if ($CameraHorizontalQuadrant= "Middle" and $CameraVerticalQuadrant= "Bottom" and $CameraIsTracking =1)
# If the eyes are tracking to the bottom
# Head will follow the eyes turning down
# as long as the object, color, etc is detected
servoup( D0,3)
servodown( D1,2)
servodown( D2,1)

$HeadPos_bleue = GetServo( D0 )
$HeadPos_blanc = GetServo( D1 )
$HeadPos_Xparent = GetServo( D2 )

# {@mayaway = you may need to adjust these numbers for your build...}
if (($HeadPos_bleue > 100) AND ($HeadPos_blanc < 100)AND ($HeadPos_Xparent < 79))
goto (center) # neck servo movement limitation
endif
endif

:center
if ($CameraIsTracking = 0 )
Servo( 1.D21,$left_Pectoral_Home )
Servo( 1.D22,$right_Pectoral_Home )
Servo(D20,$Ver_Eye_Center)
servo(D21,$Hor_Eye_Center) # If object, face, color, ect is out of camera field
# Eyes, Head & Torso will come back to center position
# {@mayaway = your REST position here...}
ControlCommand("Auto Position", AutoPositionAction, "STAND")
Sleep( 100 )
endif

Sleep( 50 )

goto (Follow)


My idea was to read the XY Outputs from the tracking control, then write equations to convert that into positioning the three Parloma Neck servos to achieve the same X, Y result. I did see this code for the Penguin.cpp shoulder:

Code:

void penguin_cb(const penguin_ros::penguin & msg) {
int cmd_up = (int)msg.up * 2 + 90 ;
int cmd_middle = ((int)msg.middle + 120 ) * 2 + 90 ;
int cmd_down = ((int)msg.down - 120 ) * 2 + 90 ;

s_up.write(cmd_up);
s_middle.write(cmd_middle);
s_down.write(cmd_down);

}


This image shows the position of Parloma Servos D0, D1, D2 in the mounting frame.
User-inserted image

#143

I've updated my project if you guys want to take a look. Might be helpful to see how I laid out my project. Emphasis on chatting using Pandorabot.

#144

Hi @Perry_S, I have the Pandorabot in place too, and created and uploaded an automation.html that calls scripts and custom Movement Panel events based on recognized commands, in addition to just chatting... You must have something similar. Best, Stephen