Skip to content

Commit

Permalink
Merge branch 'ign-gazebo6' into pose_publisher_model
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 authored Feb 24, 2022
2 parents 40509d5 + f7cd5aa commit f768cda
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/gui/plugins/component_inspector/Light.qml
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ Rectangle {
}
RowLayout {
Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.columnSpan: 6
text: " Direction"
color: "dimgrey"
Expand All @@ -845,7 +845,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: xDirectionText.width + indentation*3
Expand All @@ -859,7 +859,7 @@ Rectangle {
Component.onCompleted: loaderDirectionX.item.componentInfo = "directionX"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : xDirectionText
text: ' X:'
leftPadding: 5
Expand All @@ -869,7 +869,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -886,7 +886,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: yDirectionText.width + indentation*3
Expand All @@ -900,7 +900,7 @@ Rectangle {
Component.onCompleted: loaderDirectionY.item.componentInfo = "directionY"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : yDirectionText
text: ' Y:'
leftPadding: 5
Expand All @@ -910,7 +910,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -927,7 +927,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: zDirectionText.width + indentation*3
Expand All @@ -941,7 +941,7 @@ Rectangle {
Component.onCompleted: loaderDirectionZ.item.componentInfo = "directionZ"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : zDirectionText
text: ' Z:'
leftPadding: 5
Expand All @@ -951,7 +951,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -968,7 +968,7 @@ Rectangle {
}
RowLayout {
Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.columnSpan: 6
text: " Spot features"
color: "dimgrey"
Expand All @@ -977,7 +977,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: innerAngleText.width + indentation*3
Expand All @@ -991,7 +991,7 @@ Rectangle {
Component.onCompleted: loaderInnerAngle.item.componentInfo = "innerAngle"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : innerAngleText
text: ' Inner Angle:'
leftPadding: 5
Expand All @@ -1001,7 +1001,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -1018,7 +1018,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: outerAngleText.width + indentation*3
Expand All @@ -1032,7 +1032,7 @@ Rectangle {
Component.onCompleted: loaderOuterAngle.item.componentInfo = "outerAngle"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : outerAngleText
text: ' Outer angle:'
leftPadding: 5
Expand All @@ -1042,7 +1042,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -1059,7 +1059,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: fallOffText.width + indentation*3
Expand All @@ -1073,7 +1073,7 @@ Rectangle {
Component.onCompleted: loaderFallOff.item.componentInfo = "falloff"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : fallOffText
text: ' Falloff:'
leftPadding: 5
Expand All @@ -1083,7 +1083,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand Down
6 changes: 6 additions & 0 deletions src/rendering/RenderUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,12 @@ void RenderUtilPrivate::UpdateLights(
auto l = std::dynamic_pointer_cast<rendering::Light>(node);
if (l)
{
if (!ignition::math::equal(
l->Intensity(),
static_cast<double>(light.second.intensity())))
{
l->SetIntensity(light.second.intensity());
}
if (light.second.has_diffuse())
{
if (l->DiffuseColor() != msgs::Convert(light.second.diffuse()))
Expand Down
28 changes: 28 additions & 0 deletions src/systems/joint_state_publisher/JointStatePublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@

#include <ignition/plugin/Register.hh>

#include "ignition/gazebo/components/ChildLinkName.hh"
#include "ignition/gazebo/components/Name.hh"
#include "ignition/gazebo/components/Joint.hh"
#include "ignition/gazebo/components/JointAxis.hh"
#include "ignition/gazebo/components/JointForce.hh"
#include "ignition/gazebo/components/JointPosition.hh"
#include "ignition/gazebo/components/JointVelocity.hh"
#include "ignition/gazebo/components/ParentEntity.hh"
#include "ignition/gazebo/components/ParentLinkName.hh"
#include "ignition/gazebo/components/Pose.hh"
#include "ignition/gazebo/Util.hh"

Expand Down Expand Up @@ -208,6 +211,18 @@ void JointStatePublisher::PostUpdate(const UpdateInfo &_info,
if (pose)
msgs::Set(jointMsg->mutable_pose(), pose->Data());

auto child = _ecm.Component<components::ChildLinkName>(joint);
if (child)
{
jointMsg->set_child(child->Data());
}

auto parent = _ecm.Component<components::ParentLinkName>(joint);
if (parent)
{
jointMsg->set_parent(parent->Data());
}

// Set the joint position
const auto *jointPositions =
_ecm.Component<components::JointPosition>(joint);
Expand All @@ -218,6 +233,19 @@ void JointStatePublisher::PostUpdate(const UpdateInfo &_info,
if (i == 0)
{
jointMsg->mutable_axis1()->set_position(jointPositions->Data()[i]);
auto jointAxis = _ecm.Component<components::JointAxis>(joint);
if (jointAxis)
{
msgs::Set(
jointMsg->mutable_axis1()->mutable_xyz(),
jointAxis->Data().Xyz());
jointMsg->mutable_axis1()->set_limit_upper(
jointAxis->Data().Upper());
jointMsg->mutable_axis1()->set_limit_lower(
jointAxis->Data().Lower());
jointMsg->mutable_axis1()->set_damping(
jointAxis->Data().Damping());
}
}
else if (i == 1)
{
Expand Down
Loading

0 comments on commit f768cda

Please sign in to comment.