Skip to content

Conversation

@martha-johnston
Copy link
Contributor

https://viam.atlassian.net/browse/APP-9879

This PR adds the backend functionality for the pose sliders in both live and execute modes. The attached video shows the pose being adjusted on the viam example app (only changes to theta result in valid poses in the fake arm), and updating accordingly on app.viam.com in both modes. On app.viam.com, the arm card doesn't live update the pose, so the page must be refreshed.

Screen.Recording.2025-10-29.at.5.12.48.PM.mov

@martha-johnston martha-johnston requested a review from a team as a code owner October 29, 2025 21:22
@martha-johnston martha-johnston requested review from lia-viam and stuqdog and removed request for a team October 29, 2025 21:22
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple small things but generally looks good!

Comment on lines 52 to 60
_controlValues = [
startPose.x.roundToDouble(),
startPose.y.roundToDouble(),
startPose.z.roundToDouble(),
startPose.oX.roundToDouble(),
startPose.oY.roundToDouble(),
startPose.oZ.roundToDouble(),
startPose.theta.roundToDouble(),
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed this in the last PR (sorry!), but representing the _controlValues as a list seems not great to me. Very easy to run into issues if at any point the data representation changes. Would much prefer to have some sort of struct with named fields to make sure that we're always setting the right data to the right place.

TextEditingController theta;

_TextControlStruct(this.x, this.y, this.z, this.oX, this.oY, this.oZ, this.theta);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuqdog added this structure to also manage the textcontrollers, as they were only related to the pose before by their shared index

_controlValues.oZ = value;
case 'theta':
_controlValues.theta = value;
}
Copy link
Contributor Author

@martha-johnston martha-johnston Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only complication to using the Pose instead of the list, but I think this is pretty simple still. now we depend on a specific string passed in though so still not ideal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, definitely not ideal but it seems pretty straightforward and stable at least. Do you think it would be useful to have a default case here just in case these values change out or a new one is added somehow? Or is that not a realistic concern? I defer to your judgment!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if it's not one of these, we wouldn't want to change any arm position, so default is do nothing I guess?

onValueChanged: (newValue) => _updateControlValue(6, newValue.clamp(_minTheta, _maxTheta)),
),
],
child: Column(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all indented one less level because I removed the empty check since it's no longer a list

Base automatically changed from app-9877/pose to main October 31, 2025 17:49
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@martha-johnston martha-johnston merged commit 6b31ae1 into main Oct 31, 2025
4 checks passed
@martha-johnston martha-johnston deleted the app-9877/pose-functionality branch October 31, 2025 18:58
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.

3 participants