Skip to content
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

5 -> 6 #1359

Merged
merged 7 commits into from
Feb 24, 2022
Merged

5 -> 6 #1359

Show file tree
Hide file tree
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
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