Skip to content

Commit

Permalink
Replace pose in ViewAngle with GzPose (#1641)
Browse files Browse the repository at this point in the history
* Replace pose in ViewAngle with GzPose

Signed-off-by: youhy <[email protected]>
  • Loading branch information
AzulRadio authored Aug 11, 2022
1 parent 1cf75f3 commit 8e8aab6
Showing 1 changed file with 23 additions and 127 deletions.
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
}
}
}

0 comments on commit 8e8aab6

Please sign in to comment.