Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_gazebo_set_material_plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
ADC
ADC_2021
iri_gazebo_set_material_plugin
Commits
67daaca3
Commit
67daaca3
authored
4 years ago
by
Fernando Herrero
Browse files
Options
Downloads
Patches
Plain Diff
Update to work with gazebo-9/ubuntu-18/ros-melodic
parent
29691d00
No related branches found
No related tags found
1 merge request
!1
Update doc/images/sample_box_red.png, doc/images/sample_box_green.png,...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/color_plugin.h
+1
-1
1 addition, 1 deletion
include/color_plugin.h
src/color_plugin.cc
+10
-10
10 additions, 10 deletions
src/color_plugin.cc
with
11 additions
and
11 deletions
include/color_plugin.h
+
1
−
1
View file @
67daaca3
...
...
@@ -63,7 +63,7 @@
std
::
string
material1_name
;
std
::
string
material2_name
;
bool
trigger_state
;
gazebo
::
common
::
Color
color
;
ignition
::
math
::
Color
color
;
};
//}
...
...
This diff is collapsed.
Click to expand it.
src/color_plugin.cc
+
10
−
10
View file @
67daaca3
...
...
@@ -23,9 +23,9 @@ GZ_REGISTER_VISUAL_PLUGIN(ColorPlugin)
ColorPlugin
::
ColorPlugin
()
{
this
->
nh
=
NULL
;
this
->
material_name
=
"Gazebo/Red
Glow
"
;
this
->
material1_name
=
"Gazebo/Red
Glow
"
;
this
->
material2_name
=
"Gazebo/Green
Glow
"
;
this
->
material_name
=
"Gazebo/Red"
;
this
->
material1_name
=
"Gazebo/Red"
;
this
->
material2_name
=
"Gazebo/Green"
;
this
->
plugin_name
=
"empty_plugin_name"
;
this
->
color
.
Set
(
1
,
0
,
0
);
this
->
new_material
=
false
;
...
...
@@ -42,19 +42,19 @@ ColorPlugin::~ColorPlugin()
void
ColorPlugin
::
Load
(
gazebo
::
rendering
::
VisualPtr
_parent
,
sdf
::
ElementPtr
_sdf
)
{
this
->
model
=
_parent
;
this
->
plugin_name
=
this
->
GetHandle
().
c_str
();
if
(
_sdf
->
GetElement
(
"sdf"
)
->
HasElement
(
"material"
))
if
(
_sdf
->
HasElement
(
"material"
))
{
this
->
material1_name
=
_sdf
->
GetElement
(
"
sdf
"
)
->
Get
<
std
::
string
>
(
"material"
);
this
->
material1_name
=
_sdf
->
GetElement
(
"
material
"
)
->
Get
<
std
::
string
>
();
this
->
material_name
=
this
->
material1_name
;
this
->
new_material
=
true
;
}
if
(
_sdf
->
GetElement
(
"sdf"
)
->
HasElement
(
"material2"
))
if
(
_sdf
->
HasElement
(
"material2"
))
{
this
->
material2_name
=
_sdf
->
GetElement
(
"
sdf
"
)
->
Get
<
std
::
string
>
(
"material2"
);
this
->
material2_name
=
_sdf
->
GetElement
(
"
material2
"
)
->
Get
<
std
::
string
>
();
this
->
new_material
=
true
;
}
...
...
@@ -126,4 +126,4 @@ void ColorPlugin::OnUpdate()
this
->
model
->
SetEmissive
(
this
->
color
);
this
->
new_color
=
false
;
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment