Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated marionette for jumping

  • Loading branch information...
commit 9f5163580eccdac813684e39e7d55f25f59ab613 1 parent c1d4a33
Jon Eisen authored
Showing with 23 additions and 11 deletions.
  1. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.dll
  2. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.pdb
  3. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.exe
  4. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.pdb
  5. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/Utilities.dll
  6. BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/Utilities.pdb
  7. BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
  8. BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/ResolveAssemblyReference.cache
  9. +4 −0 RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.csproj.FileListAbsolute.txt
  10. BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.dll
  11. BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.pdb
  12. BIN  RoboticNaturalUserInterface/RoboticNaturalUserInterface.suo
  13. +6 −3 RoboticNaturalUserInterface/RoboticNaturalUserInterface/KinectAdapter/SkeletalJointMonitor.cs
  14. +3 −3 RoboticNaturalUserInterface/RoboticNaturalUserInterface/Management/robonui.json
  15. +0 −2  RoboticNaturalUserInterface/RoboticNaturalUserInterface/RobotAdapter/RoboticArmModel.cs
  16. +10 −3 RoboticNaturalUserInterface/RoboticNaturalUserInterface/RobotAdapter/RoboticMarionetteModel.cs
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.dll
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.pdb
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.exe
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.pdb
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/Utilities.dll
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/bin/Release/Utilities.pdb
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/ResolveAssemblyReference.cache
Binary file not shown
View
4 RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.csproj.FileListAbsolute.txt
@@ -12,3 +12,7 @@ C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Rel
C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Release\Newtonsoft.Json.Net35.xml
C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\obj\Release\RoboNuiTest.dll
C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\obj\Release\RoboNuiTest.pdb
+C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Release\Emgu.CV.dll
+C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Release\Emgu.Util.dll
+C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Release\Emgu.CV.xml
+C:\Users\Eisen\Code\RoboNUI\repo\RoboticNaturalUserInterface\RoboNuiTest\bin\Release\Emgu.Util.xml
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.dll
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.pdb
Binary file not shown
View
BIN  RoboticNaturalUserInterface/RoboticNaturalUserInterface.suo
Binary file not shown
View
9 RoboticNaturalUserInterface/RoboticNaturalUserInterface/KinectAdapter/SkeletalJointMonitor.cs
@@ -117,9 +117,12 @@ void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
foreach (JointID jid in _InterestedJoints)
{
- Joint j = human.Joints[jid];
- Position3d pos = new Position3d(j.Position.X, j.Position.Y, j.Position.Z);
- jset.JointMap[(ControllerJoints)jid] = pos;
+ if (jid < JointID.Count)
+ {
+ Joint j = human.Joints[jid];
+ Position3d pos = new Position3d(j.Position.X, j.Position.Y, j.Position.Z);
+ jset.JointMap[(ControllerJoints)jid] = pos;
+ }
}
}
}
View
6 RoboticNaturalUserInterface/RoboticNaturalUserInterface/Management/robonui.json
@@ -4,7 +4,7 @@
{
"RobotAdapter" :
{
- "UseArm" : 0,
+ "UseArm" : 1,
"Arm" :
{
"Port" : "COM5",
@@ -13,7 +13,7 @@
"Marionette" :
{
- "Port" : "COM3"
+ "Port" : "COM4"
},
},
@@ -23,7 +23,7 @@
},
"Core" :
- {
+ {
"UseVoice": 1
}
}
View
2  RoboticNaturalUserInterface/RoboticNaturalUserInterface/RobotAdapter/RoboticArmModel.cs
@@ -49,7 +49,6 @@ public RoboticArmModel()
neededJointsRight.Add(ControllerJoints.WristRight);
neededJointsRight.Add(ControllerJoints.HandRight);
neededJointsRight.Add(ControllerJoints.Fingertip);
- neededJointsRight.Add(ControllerJoints.Fingertip);
neededJointsLeft = new List<ControllerJoints>();
neededJointsLeft.Add(ControllerJoints.ShoulderCenter);
@@ -58,7 +57,6 @@ public RoboticArmModel()
neededJointsLeft.Add(ControllerJoints.WristLeft);
neededJointsLeft.Add(ControllerJoints.HandLeft);
neededJointsLeft.Add(ControllerJoints.Fingertip);
- neededJointsLeft.Add(ControllerJoints.Fingertip);
UseRightArm = true;
View
13 RoboticNaturalUserInterface/RoboticNaturalUserInterface/RobotAdapter/RoboticMarionetteModel.cs
@@ -28,6 +28,8 @@ class RoboticMarionetteModel : IRoboticModel
List<double> heights;
+ double avghipcenter = 0;
+
/**
* <summary>Construct the Robotic Marionette Model</summary>
*
@@ -45,6 +47,7 @@ public RoboticMarionetteModel()
NeededJoints.Add(ControllerJoints.HipCenter);
NeededJoints.Add(ControllerJoints.KneeLeft);
NeededJoints.Add(ControllerJoints.KneeRight);
+ avghipcenter = 0;
}
/**
@@ -60,6 +63,7 @@ public AngleSet Reset()
angles.AngleMap.Add(RoboticAngle.RightArmLift, 0);
angles.AngleMap.Add(RoboticAngle.RearLift, 0);
angles.AngleMap.Add(RoboticAngle.CurtainOpen, Math.PI);
+ avghipcenter = 0;
return angles;
}
@@ -69,6 +73,9 @@ public AngleSet Reset()
*/
public AngleSet Translate(JointSet js)
{
+ double hipdiff = js.JointMap[ControllerJoints.HipCenter].y - avghipcenter;
+ avghipcenter = (avghipcenter + js.JointMap[ControllerJoints.HipCenter].y) / 2;
+
// Find the height above for each node
Position3d lefthand = js.JointMap[ControllerJoints.HandLeft] - js.JointMap[ControllerJoints.ShoulderLeft];
Position3d righthand = js.JointMap[ControllerJoints.HandRight] - js.JointMap[ControllerJoints.ShoulderRight];
@@ -83,10 +90,10 @@ public AngleSet Translate(JointSet js)
double bendAngle = Math.Atan2(delz, dely);
double bendPct = Math.PI/4 - (bendAngle - Math.PI/2) / (Math.PI/2);
- double headAngle = bendAngle * Math.PI * 2 - Math.PI;
- double rearAngle = -headAngle;
+ double headAngle = bendAngle * Math.PI * 2 - Math.PI - hipdiff;
+ double rearAngle = -headAngle - hipdiff;
- log.ErrorFormat("bend: {0}", bendAngle);
+ log.ErrorFormat("handRight: {0}", handRightAngle);
AngleSet angles = new AngleSet();
angles.AngleMap.Add(RoboticAngle.HeadLift, headAngle);
Please sign in to comment.
Something went wrong with that request. Please try again.