Skip to content

Solve cursor movement on custom workplane sometimes not working#72

Open
rondlh wants to merge 1 commit intoCommonWealthRobotics:developmentfrom
rondlh:Solve-cursor-movement-not-working-issue
Open

Solve cursor movement on custom workplane sometimes not working#72
rondlh wants to merge 1 commit intoCommonWealthRobotics:developmentfrom
rondlh:Solve-cursor-movement-not-working-issue

Conversation

@rondlh
Copy link
Contributor

@rondlh rondlh commented Mar 3, 2026

=== REVIEW BEFORE MERGE===

Solve cursor movement not working.

Sometimes the object doesn't move on a custom work plane when the cursor keys are pressed, then this exception is thrown:
Error com.neuronrobotics.sdk.common.Log:error:

  [16:29:19.706] com.neuronrobotics.bowlerstudio.scripting.cadoodle.InvalidLocationMove
        at com.neuronrobotics.bowlerstudio.scripting.cadoodle.MoveCenter.setLocation(MoveCenter.java:157)
        at com.commonwealthrobotics.controls.SelectionSession.lambda$moveInCameraFrame$49(SelectionSession.java:1961)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)

It is thrown here:
public MoveCenter setLocation(TransformNR location) throws InvalidLocationMove {

	if (isWorkplaneNotOrigin(location))
		this.location = location;
	else {
		throw new InvalidLocationMove();
	}
	return this;
}

I am not sure why isWorkplaneNotOrigin is required here. The provided "location" seems to be the object location relative to the custom work plane. In "location" no rotation is present, and the object "translation" is relative to the custom work plane. That means that when object goes through the origin the exception is thrown and the object does not move.
Here is the data that "location" holds:

{ 001.00,       000.00, 000.00, 000.00   },
{ 000.00,       001.00, 000.00, 000.00   },
{ 000.00,       000.00, 001.00, 000.00   },
{ 000.00,       000.00, 000.00, 001.00   }
Quaturnion: W=1.0, x=-0.0, y=-0.0, z=-0.0
Rotation angle (degrees): az= 0.0, elev= -0.0, tilt=0.0

This PR removes the requirement of "isWorkplaneNotOrigin" for saving the new object location.

Solve cursor movement not working
@madhephaestus
Copy link
Member

This exception was added to act as a feedback channel for invalid transform moves being added to the timeline. I guess we can roll that back. but it may be better to handle the exception rather than to fail to throw it in all cases, as some code depends on detecting the invalid transform to throw an exception to be handled correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants