Skip to content

Commit

Permalink
Merge branch 'develop' of github.com-myrobotlab:MyRobotLab/myrobotlab…
Browse files Browse the repository at this point in the history
… into inmoov-and-statemachine-1
  • Loading branch information
supertick committed Nov 15, 2023
2 parents 3d4c7e1 + 10eb2f5 commit 6a8d930
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 33 deletions.
54 changes: 27 additions & 27 deletions src/main/java/org/myrobotlab/service/WebXR.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public WebXR(String n, String id) {
}

public Event publishEvent(Event event) {
// if (log.isDebugEnabled()) {
log.info("publishEvent XRController {}", event);
// }
if (log.isDebugEnabled()) {
log.debug("publishEvent {}", event);
}

String path = String.format("event.%s.%s", event.meta.get("handedness"), event.type);
if (event.value != null) {
Expand All @@ -53,9 +53,9 @@ public Event publishEvent(Event event) {
* @return
*/
public Pose publishPose(Pose pose) {
// if (log.isDebugEnabled()) {
log.error("publishPose {}", pose);
// }
if (log.isDebugEnabled()) {
log.debug("publishPose {}", pose);
}
// process mappings config into joint angles
Map<String, Double> map = new HashMap<>();

Expand Down Expand Up @@ -83,27 +83,27 @@ public Pose publishPose(Pose pose) {
}
}

// InverseKinematics3D ik = (InverseKinematics3D)Runtime.getService("ik3d");
// if (ik != null && pose.name.equals("left")) {
// ik.setCurrentArm("left", InMoov2Arm.getDHRobotArm("i01", "left"));
//
// ik.centerAllJoints("left");
//
// for (int i = 0; i < 1000; ++i) {
//
// ik.centerAllJoints("left");
// ik.moveTo("left", 0, 0.0+ i * 0.02, 0.0);
//
//
// // ik.moveTo(pose.name, new Point(0, -200, 50));
// }
//
// // map name
// // and then map all position and rotation too :P
// Point p = new Point(70 + pose.position.x, -550 + pose.position.y, pose.position.z);
//
// ik.moveTo(pose.name, p);
// }
InverseKinematics3D ik = (InverseKinematics3D)Runtime.getService("ik3d");
if (ik != null && pose.name.equals("left")) {
ik.setCurrentArm("left", InMoov2Arm.getDHRobotArm("i01", "left"));

ik.centerAllJoints("left");

for (int i = 0; i < 1000; ++i) {

ik.centerAllJoints("left");
ik.moveTo("left", 0, 0.0+ i * 0.02, 0.0);


// ik.moveTo(pose.name, new Point(0, -200, 50));
}

// map name
// and then map all position and rotation too :P
Point p = new Point(70 + pose.position.x, -550 + pose.position.y, pose.position.z);

ik.moveTo(pose.name, p);
}

if (map.size() > 0) {
invoke("publishJointAngles", map);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.myrobotlab.service.interfaces;

import org.myrobotlab.framework.interfaces.JsonInvoker;
import org.myrobotlab.framework.interfaces.JsonSender;

/**
Expand All @@ -11,7 +10,7 @@
* @author GroG
*
*/
public interface Executor extends JsonInvoker, JsonSender {
public interface Executor extends JsonSender {

/**
* exec in Python - executes arbitrary code
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/myrobotlab/vertx/WebSocketHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ public void handle(ServerWebSocket socket) {
// client
MultiMap headers = socket.headers();
String uri = socket.uri();
// String remoteId = r.getRequest().getParameter("id");
String id = String.format("vertx-%s", service.getName());
// String uuid = UUID.randomUUID().toString();
String uuid = socket.binaryHandlerID();
Connection connection = new Connection(uuid, id, service.getName());
connection.put("c-type", service.getSimpleName());
connection.put("gateway", service.getName());
Expand Down

0 comments on commit 6a8d930

Please sign in to comment.