Skip to content

Replace pose in ViewAngle with GzPose #1641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 23 additions & 127 deletions src/gui/plugins/view_angle/ViewAngle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -194,136 +194,32 @@ ToolBar {
width: parent.width
color: "transparent"

ColumnLayout {
width: parent.width
Text {
text: "Camera Pose"
color: Material.Grey
Layout.row: 4
Layout.column: 1
leftPadding: 5
}

GridLayout {
width: parent.width
columns: 6
Text {
text: "Camera Pose"
Layout.fillWidth: true
color: Material.Grey
leftPadding: 5
font.bold: true
}

Text {
text: "X (m)"
color: "dimgrey"
Layout.row: 4
Layout.column: 1
leftPadding: 5
}
IgnSpinBox {
id: x
Layout.fillWidth: true
Layout.row: 4
Layout.column: 2
value: ViewAngle.camPose[0]
maximumValue: 1000000
minimumValue: -1000000
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
Text {
text: "Y (m)"
color: "dimgrey"
Layout.row: 5
Layout.column: 1
leftPadding: 5
}
IgnSpinBox {
id: y
Layout.fillWidth: true
Layout.row: 5
Layout.column: 2
value: ViewAngle.camPose[1]
maximumValue: 1000000
minimumValue: -1000000
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
Text {
text: "Z (m)"
color: "dimgrey"
Layout.row: 6
Layout.column: 1
leftPadding: 5
}
IgnSpinBox {
id: z
Layout.fillWidth: true
Layout.row: 6
Layout.column: 2
value: ViewAngle.camPose[2]
maximumValue: 1000000
minimumValue: -1000000
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
GzPose {
y: 30
width: parent.width
Layout.fillWidth: true
readOnly: false
xValue: ViewAngle.camPose[0]
yValue: ViewAngle.camPose[1]
zValue: ViewAngle.camPose[2]
rollValue: ViewAngle.camPose[3]
pitchValue: ViewAngle.camPose[4]
yawValue: ViewAngle.camPose[5]

Text {
text: "Roll (rad)"
color: "dimgrey"
Layout.row: 4
Layout.column: 3
leftPadding: 5
}
IgnSpinBox {
id: roll
Layout.fillWidth: true
Layout.row: 4
Layout.column: 4
value: ViewAngle.camPose[3]
maximumValue: 6.28
minimumValue: -6.28
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
Text {
text: "Pitch (rad)"
color: "dimgrey"
Layout.row: 5
Layout.column: 3
leftPadding: 5
}
IgnSpinBox {
id: pitch
Layout.fillWidth: true
Layout.row: 5
Layout.column: 4
value: ViewAngle.camPose[4]
maximumValue: 6.28
minimumValue: -6.28
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
Text {
text: "Yaw (rad)"
color: "dimgrey"
Layout.row: 6
Layout.column: 3
leftPadding: 5
}
IgnSpinBox {
id: yaw
Layout.fillWidth: true
Layout.row: 6
Layout.column: 4
value: ViewAngle.camPose[5]
maximumValue: 6.28
minimumValue: -6.28
decimals: 6
stepSize: 0.01
onEditingFinished: ViewAngle.SetCamPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}
onGzPoseSet: {
// _x, _y, _z, _roll, _pitch, _yaw are parameters of signal gzPoseSet
// from gz-gui GzPose.qml
ViewAngle.SetCamPose(_x, _y, _z, _roll, _pitch, _yaw)
}
expand: true
}
}
}