Skip to content

Commit

Permalink
replace pose for grid3d with gzpose
Browse files Browse the repository at this point in the history
Signed-off-by: youhy <[email protected]>
  • Loading branch information
AzulRadio committed Aug 9, 2022
1 parent ec16040 commit 451146b
Showing 1 changed file with 27 additions and 98 deletions.
125 changes: 27 additions & 98 deletions src/plugins/grid_3d/Grid3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ GridLayout {
horizontalCellCount.value = _hCellCount;
verticalCellCount.value = _vCellCount;
cellLength.value = _cellLength;
x.value = _pos.x;
y.value = _pos.y;
z.value = _pos.z;
roll.value = _rot.x;
pitch.value = _rot.y;
yaw.value = _rot.z;
gzPoseInstance.xValue = _pos.x;
gzPoseInstance.yValue = _pos.y;
gzPoseInstance.zValue = _pos.z;
gzPoseInstance.rollValue = _rot.x;
gzPoseInstance.pitchValue = _rot.y;
gzPoseInstance.yawValue = _rot.z;
gzColorGrid.r = _color.r;
gzColorGrid.g = _color.g;
gzColorGrid.b = _color.b;
Expand Down Expand Up @@ -175,107 +175,36 @@ GridLayout {
}

Text {
Layout.columnSpan: 2
Layout.columnSpan: 1
id: principal
text: "Rotation (rad)"
color: "dimgrey"
font.bold: true
}

Text {
text: "X"
color: "dimgrey"
}

IgnSpinBox {
Layout.fillWidth: true
id: x
value: 0.00
maximumValue: Number.MAX_VALUE
minimumValue: -Number.MAX_VALUE
decimals: getDecimals(x.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}

Text {
text: "Roll"
color: "dimgrey"
}

IgnSpinBox {
Layout.fillWidth: true
id: roll
maximumValue: 6.28
minimumValue: 0.00
value: 0.00
decimals: getDecimals(roll.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}

Text {
text: "Y"
color: "dimgrey"
}

IgnSpinBox {
Layout.fillWidth: true
id: y
value: 0.00
maximumValue: Number.MAX_VALUE
minimumValue: -Number.MAX_VALUE
decimals: getDecimals(y.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}

Text {
text: "Pitch"
color: "dimgrey"
}

IgnSpinBox {
Layout.fillWidth: true
id: pitch
maximumValue: 6.28
minimumValue: 0.00
value: 0.00
decimals: getDecimals(pitch.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}

Text {
text: "Z"
color: "dimgrey"
}

IgnSpinBox {
Layout.fillWidth: true
id: z
value: 0.00
maximumValue: Number.MAX_VALUE
minimumValue: -Number.MAX_VALUE
decimals: getDecimals(z.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
}

Text {
text: "Yaw"
color: "dimgrey"
// dummy item for formatting
Item {
Layout.columnSpan: 1
}

IgnSpinBox {
GzPose {
id: gzPoseInstance
Layout.columnSpan: 4
Layout.fillWidth: true
id: yaw
maximumValue: 6.28
minimumValue: 0.00
value: 0.00
decimals: getDecimals(yaw.width)
stepSize: 0.01
onEditingFinished: Grid3D.SetPose(x.value, y.value, z.value, roll.value, pitch.value, yaw.value)
readOnly: false
xValue: 0.00
yValue: 0.00
zValue: 0.00
rollValue: 0.00
pitchValue: 0.00
yawValue: 0.00

onGzPoseSet: {
// _x, _y, _z, _roll, _pitch, _yaw are parameters of signal gzPoseSet
// from gz-gui GzPose.qml
Grid3D.SetPose(_x, _y, _z, _roll, _pitch, _yaw)
}
expand: true
}

Text {
Expand Down

0 comments on commit 451146b

Please sign in to comment.