Skip to content

Commit

Permalink
apply v to Motors instead of Joints
Browse files Browse the repository at this point in the history
  • Loading branch information
i-make-robots committed Dec 21, 2023
1 parent 6d65dcd commit 47f9b5c
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 75 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.marginallyclever</groupId>
<artifactId>RobotOverlord</artifactId>
<version>2.11.0</version>
<version>2.90.0</version>
<name>Robot Overlord</name>
<description>A friendly 3D user interface for controlling robots.</description>
<url>http://www.marginallyclever.com/</url>
Expand Down Expand Up @@ -132,7 +132,7 @@
<SplashScreen-Image>splash.png</SplashScreen-Image>
</manifestEntries>
<manifest>
<mainClass>com.marginallyclever.robotoverlord.RobotOverlord</mainClass>
<mainClass>com.marginallyclever.ro3.RO3</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/marginallyclever/ro3/RO3Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RO3Frame extends JFrame {
private final List<DockingPanel> windows = new ArrayList<>();

public RO3Frame() {
super("RO3");
super("Robot Overlord 3");

setLookAndFeel();

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/marginallyclever/ro3/node/nodes/Motor.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import java.awt.*;
import java.util.List;

/**
* a {@link Motor} is a {@link Node} that can be attached to a {@link HingeJoint}.
*/
public class Motor extends Node {
private HingeJoint hinge;

Expand Down Expand Up @@ -76,4 +79,8 @@ public HingeJoint getAxle() {
public void setAxle(HingeJoint hinge) {
this.hinge = hinge;
}

public boolean hasAxle() {
return hinge!=null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected ApproximateJacobianFiniteDifferences(MarlinRobotArm arm) {
Pose endEffector = arm.getEndEffector();
if(endEffector==null) throw new InvalidParameterException("Robot must have an end effector.");

double[] jointAnglesOriginal = arm.getAllJointValues();
double[] jointAnglesOriginal = arm.getAllJointAngles();
Matrix4d endEffectorPose = endEffector.getWorld();
Matrix4d endEffectorDifference = new Matrix4d();
Matrix3d endEffectorPoseRotation = new Matrix3d();
Expand All @@ -31,7 +31,7 @@ protected ApproximateJacobianFiniteDifferences(MarlinRobotArm arm) {
// use anglesB to get the hand matrix after a tiny adjustment on one joint.
double[] jointAnglesPlusDelta = Arrays.copyOf(jointAnglesOriginal, jointAnglesOriginal.length);
jointAnglesPlusDelta[i] += ANGLE_STEP_SIZE_DEGREES;
arm.setAllJointValues(jointAnglesPlusDelta);
arm.setAllJointAngles(jointAnglesPlusDelta);
Matrix4d endEffectorPosePlusDelta = endEffector.getWorld();

// use the finite difference in the two matrixes
Expand Down Expand Up @@ -59,7 +59,7 @@ protected ApproximateJacobianFiniteDifferences(MarlinRobotArm arm) {
jacobian[5][i] = skewSymmetric.m01;
}
} finally {
arm.setAllJointValues(jointAnglesOriginal);
arm.setAllJointAngles(jointAnglesOriginal);
arm.update(0);
}
}
Expand Down
Loading

0 comments on commit 47f9b5c

Please sign in to comment.