Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Feniks
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Robotlab
De Nieuw Rollende Hollander
Feniks
Commits
cb849b52
Commit
cb849b52
authored
3 years ago
by
Galambos Mihály
Browse files
Options
Downloads
Patches
Plain Diff
Separate simulation and description bringup
parent
8f1dc0ff
Branches
feature/robot_description
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hollander_bringup/launch/description.launch.py
+51
-0
51 additions, 0 deletions
src/hollander_bringup/launch/description.launch.py
src/hollander_bringup/launch/simulation.launch.py
+11
-28
11 additions, 28 deletions
src/hollander_bringup/launch/simulation.launch.py
with
62 additions
and
28 deletions
src/hollander_bringup/launch/description.launch.py
0 → 100644
+
51
−
0
View file @
cb849b52
import
os
from
launch_ros.actions
import
Node
from
launch
import
LaunchDescription
from
launch.actions
import
DeclareLaunchArgument
from
launch.substitutions
import
Command
,
LaunchConfiguration
from
ament_index_python.packages
import
get_package_share_directory
def
generate_launch_description
():
# Get package dirs
package_dir
=
get_package_share_directory
(
'
hollander_description
'
)
# Default values
default_model_path
=
os
.
path
.
join
(
package_dir
,
'
src/description/rollende_hollander.urdf
'
)
configurable_parameters
=
[
{
'
name
'
:
'
model
'
,
'
default
'
:
default_model_path
,
'
description
'
:
'
Absolute path to robot urdf file
'
},
{
'
name
'
:
'
namespace
'
,
'
default
'
:
'
hollander
'
,
'
description
'
:
'
Namespace to avoide conflicts
'
},
{
'
name
'
:
'
log_level
'
,
'
default
'
:
'
info
'
,
'
description
'
:
'
debug log level [DEBUG|INFO|WARN|ERROR|FATAL]
'
},
]
def
declare_configurable_parameters
(
parameters
):
return
[
DeclareLaunchArgument
(
param
[
'
name
'
],
default_value
=
param
[
'
default
'
],
description
=
param
[
'
description
'
])
for
param
in
parameters
]
"""
NODES
"""
robot_state_publisher_node
=
Node
(
package
=
'
robot_state_publisher
'
,
executable
=
'
robot_state_publisher
'
,
name
=
'
robot_state_publisher
'
,
namespace
=
LaunchConfiguration
(
"
namespace
"
),
parameters
=
[{
'
robot_description
'
:
Command
([
'
xacro
'
,
LaunchConfiguration
(
'
model
'
)])}],
arguments
=
[
'
--ros-args
'
,
'
--log-level
'
,
LaunchConfiguration
(
'
log_level
'
)],
emulate_tty
=
True
,
)
joint_state_publisher_node
=
Node
(
package
=
'
joint_state_publisher
'
,
executable
=
'
joint_state_publisher
'
,
name
=
'
joint_state_publisher
'
,
namespace
=
LaunchConfiguration
(
"
namespace
"
),
arguments
=
[
'
--ros-args
'
,
'
--log-level
'
,
LaunchConfiguration
(
'
log_level
'
)],
emulate_tty
=
True
,
)
return
LaunchDescription
(
declare_configurable_parameters
(
configurable_parameters
)
+
[
robot_state_publisher_node
,
joint_state_publisher_node
,
])
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/hollander_bringup/launch/simulation.launch.py
+
11
−
28
View file @
cb849b52
import
os
from
launch
import
LaunchDescription
from
launch.actions
import
DeclareLaunchArgument
,
ExecuteProcess
from
launch_ros.actions
import
Node
from
launch.substitutions
import
Command
,
LaunchConfiguration
from
launch
import
LaunchDescription
from
launch.conditions
import
IfCondition
from
launch.substitutions
import
LaunchConfiguration
from
launch.actions
import
DeclareLaunchArgument
,
ExecuteProcess
,
IncludeLaunchDescription
from
ament_index_python.packages
import
get_package_share_directory
from
launch.launch_description_sources
import
PythonLaunchDescriptionSource
def
generate_launch_description
():
# Get package dirs
launch_dir
=
get_package_share_directory
(
'
hollander_bringup
'
)
package_dir
=
get_package_share_directory
(
'
hollander_description
'
)
# Default values
default_model_path
=
os
.
path
.
join
(
package_dir
,
'
src/description/rollende_hollander.urdf
'
)
default_rviz_config_path
=
os
.
path
.
join
(
launch_dir
,
'
rviz/urdf_config.rviz
'
)
# Parameters
configurable_parameters
=
[
{
'
name
'
:
'
model
'
,
'
default
'
:
default_model_path
,
'
description
'
:
'
Absolute path to robot urdf file
'
},
{
'
name
'
:
'
need_rviz
'
,
'
default
'
:
'
False
'
,
'
description
'
:
'
Whether launch or not rviz
'
},
{
'
name
'
:
'
rvizconfig
'
,
'
default
'
:
default_rviz_config_path
,
'
description
'
:
'
Absolute path to rviz config file
'
},
{
'
name
'
:
'
use_sim_time
'
,
'
default
'
:
'
True
'
,
'
description
'
:
'
Flag to enable use_sim_time
'
},
...
...
@@ -28,19 +27,12 @@ def generate_launch_description():
def
declare_configurable_parameters
(
parameters
):
return
[
DeclareLaunchArgument
(
param
[
'
name
'
],
default_value
=
param
[
'
default
'
],
description
=
param
[
'
description
'
])
for
param
in
parameters
]
"""
NODES
"""
robot_state_publisher_node
=
Node
(
package
=
'
robot_state_publisher
'
,
executable
=
'
robot_state_publisher
'
,
parameters
=
[{
'
robot_description
'
:
Command
([
'
xacro
'
,
LaunchConfiguration
(
'
model
'
)])}]
)
joint_state_publisher_node
=
Node
(
package
=
'
joint_state_publisher
'
,
executable
=
'
joint_state_publisher
'
,
name
=
'
joint_state_publisher
'
,
description
=
IncludeLaunchDescription
(
PythonLaunchDescriptionSource
(
os
.
path
.
join
(
get_package_share_directory
(
'
hollander_bringup
'
),
'
launch
'
,
'
description.launch.py
'
)),
condition
=
IfCondition
(
LaunchConfiguration
(
'
need_description
'
))
)
"""
NODES
"""
rviz_node
=
Node
(
package
=
'
rviz2
'
,
executable
=
'
rviz2
'
,
...
...
@@ -56,21 +48,12 @@ def generate_launch_description():
output
=
'
screen
'
)
robot_localization_node
=
Node
(
package
=
'
robot_localization
'
,
executable
=
'
ekf_node
'
,
name
=
'
ekf_filter_node
'
,
output
=
'
screen
'
,
parameters
=
[
os
.
path
.
join
(
launch_dir
,
'
config/simulation.ekf.yaml
'
),
{
'
use_sim_time
'
:
LaunchConfiguration
(
'
use_sim_time
'
)}]
)
return
LaunchDescription
(
declare_configurable_parameters
(
configurable_parameters
)
+
[
ExecuteProcess
(
cmd
=
[
'
gazebo
'
,
'
--verbose
'
,
'
-s
'
,
'
libgazebo_ros_init.so
'
,
'
-s
'
,
'
libgazebo_ros_factory.so
'
],
output
=
'
screen
'
),
robot_state_publisher_node
,
joint_state_publisher_node
,
description
,
spawn_entity
,
robot_localization_node
,
rviz_node
,
])
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