-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'humble' into francocipollone/github
- Loading branch information
Showing
7 changed files
with
269 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# More info: | ||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners | ||
|
||
* @agalbachicar @lneumarkt @francocipollone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Bug report | ||
about: Report a bug | ||
labels: bug | ||
--- | ||
|
||
|
||
## Environment | ||
* OS Version: <!-- e.g, Ubuntu 22.04 --> | ||
* Source or binary build? | ||
<!-- If binary, which version? --> | ||
<!-- If source, which branch and what is the latest commit? --> | ||
|
||
## Description | ||
* Expected behavior: <!-- Tell us what you expected to happen --> | ||
* Actual behavior: <!-- What happened instead --> | ||
|
||
## Steps to reproduce | ||
<!-- Provide steps so we can try to reproduce this issue --> | ||
|
||
1. | ||
2. | ||
3. | ||
|
||
## Output | ||
<!-- Provide screenshots, console logs, backtraces, and/or anything that could | ||
be useful to us resolving this issue --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Request a new feature | ||
labels: enhancement | ||
--- | ||
|
||
|
||
## Desired behavior | ||
<!-- Describe the current problem and the feature you want implemented.--> | ||
|
||
## Alternatives considered | ||
<!-- Describe alternate solutions or features you've considered.--> | ||
|
||
## Implementation suggestion | ||
<!-- Provide a suggestion on how to implement this feature, which could help us | ||
expedite this implementation.--> | ||
|
||
## Additional context | ||
<!-- Provide any other additional context (e.g., screenshots) about your feature | ||
request.--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- | ||
Please remove the appropriate section. | ||
For example, if this is a new feature, remove all sections except for the "New feature" section | ||
If this is your first time opening a PR, be sure to check the contribution guide: | ||
https://github.com/Ekumen-OS/andino_gz/blob/humble/CONTRIBUTING.md | ||
--> | ||
|
||
# 🦟 Bug fix | ||
|
||
Fixes #<NUMBER> | ||
|
||
## Summary | ||
<!-- Describe your fix, including an explanation of how to reproduce the bug | ||
before and after the PR.--> | ||
|
||
## Checklist | ||
- [ ] Signed all commits for DCO | ||
- [ ] Added tests | ||
- [ ] Updated documentation (as needed) | ||
- [ ] Updated migration guide (as needed) | ||
|
||
|
||
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸 | ||
|
||
# 🎉 New feature | ||
|
||
Closes #<NUMBER> | ||
|
||
## Summary | ||
<!--Explain changes made, the expected behavior, and provide any other additional | ||
context (e.g., screenshots, gifs) if appropriate.--> | ||
|
||
## Test it | ||
<!--Explain how reviewers can test this new feature manually.--> | ||
|
||
## Checklist | ||
- [ ] Signed all commits for DCO | ||
- [ ] Added tests | ||
- [ ] Added example and/or tutorial | ||
- [ ] Updated documentation (as needed) | ||
- [ ] Updated migration guide (as needed) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
"""Spawn an Andino robot in new Gazebo, also launch the robot_state_publisher.""" | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.conditions import IfCondition | ||
from launch.substitutions import LaunchConfiguration | ||
from launch.substitutions import PythonExpression | ||
from launch_ros.actions import Node | ||
from xacro import process_file | ||
|
||
PKG_ANDINO_DESCRIPTION = get_package_share_directory('andino_description') | ||
PKG_ANDINO_GZ = get_package_share_directory('andino_gz') | ||
|
||
def get_robot_description() -> str: | ||
""" | ||
Obtain the URDF from the xacro file. | ||
This replace package tag by file tag to works with gazebo | ||
# See https://github.com/ros-simulation/gazebo_ros_pkgs/pull/1284 | ||
Considerations: the URDF model of the robot will be set with certain | ||
presets: | ||
- use_fixed_caster: false | ||
Returns | ||
------- | ||
URDF of the robot with gazebo data | ||
""" | ||
# Parse robot description from xacro | ||
robot_description_file_path = os.path.join(PKG_ANDINO_GZ, 'urdf', 'andino_gz.urdf.xacro') | ||
mappings = {'use_fixed_caster': 'false'} | ||
robot_description_config = process_file(robot_description_file_path, mappings=mappings) | ||
robot_desc = robot_description_config.toprettyxml(indent=' ') | ||
# Passing absolute path to the robot description due to Gazebo issues finding andino_description pkg path. | ||
robot_desc = robot_desc.replace( | ||
'package://andino_description/', f'file://{PKG_ANDINO_DESCRIPTION}/' | ||
) | ||
return robot_desc | ||
|
||
|
||
def generate_launch_description(): | ||
# Arguments | ||
entity = LaunchConfiguration('entity') | ||
initial_pose_x = LaunchConfiguration('initial_pose_x') | ||
initial_pose_y = LaunchConfiguration('initial_pose_y') | ||
initial_pose_z = LaunchConfiguration('initial_pose_z') | ||
initial_pose_yaw = LaunchConfiguration('initial_pose_yaw') | ||
robot_description_topic = LaunchConfiguration('robot_description_topic') | ||
rsp_frequency = LaunchConfiguration('rsp_frequency') | ||
use_sim_time = LaunchConfiguration('use_sim_time') | ||
|
||
entity_argument = DeclareLaunchArgument( | ||
'entity', default_value='andino', description='Name of the robot.' | ||
) | ||
x_argument = DeclareLaunchArgument( | ||
'initial_pose_x', | ||
default_value='0.0', | ||
description='Initial x pose of andino in the simulation.', | ||
) | ||
y_argument = DeclareLaunchArgument( | ||
'initial_pose_y', | ||
default_value='0.0', | ||
description='Initial y pose of andino in the simulation', | ||
) | ||
z_argument = DeclareLaunchArgument( | ||
'initial_pose_z', | ||
default_value='0.1', | ||
description='Initial z pose of andino in the simulation.', | ||
) | ||
yaw_argument = DeclareLaunchArgument( | ||
'initial_pose_yaw', | ||
default_value='0.0', | ||
description='Initial yaw pose of andino in the simulation.', | ||
) | ||
robot_desc_argument = DeclareLaunchArgument( | ||
'robot_description_topic', | ||
default_value='/robot_description', | ||
description='Robot description topic.', | ||
) | ||
rsp_frequency_argument = DeclareLaunchArgument( | ||
'rsp_frequency', | ||
default_value='30.0', | ||
description='Robot State Publisher frequency.', | ||
) | ||
use_sim_time_argument = DeclareLaunchArgument( | ||
'use_sim_time', | ||
default_value='true', | ||
description='Use simulation (Gazebo) clock if true', | ||
) | ||
|
||
# Robot state publisher. | ||
rsp_node = Node( | ||
package='robot_state_publisher', | ||
executable='robot_state_publisher', | ||
name='robot_state_publisher', | ||
output='both', | ||
parameters=[ | ||
{ | ||
'use_sim_time': use_sim_time, | ||
'publish_frequency': rsp_frequency, | ||
'robot_description': get_robot_description(), | ||
} | ||
], | ||
) | ||
|
||
# Spawn the robot model. | ||
spawn_node = Node( | ||
package='ros_gz_sim', | ||
executable='create', | ||
arguments=[ | ||
'-name', entity, | ||
'-topic', robot_description_topic, | ||
'-x', initial_pose_x, | ||
'-y', initial_pose_y, | ||
'-z', initial_pose_z, | ||
'-R', '0', | ||
'-P', '0', | ||
'-Y', initial_pose_yaw, | ||
], | ||
output='screen', | ||
) | ||
|
||
return LaunchDescription( | ||
[ | ||
entity_argument, | ||
x_argument, | ||
y_argument, | ||
z_argument, | ||
yaw_argument, | ||
robot_desc_argument, | ||
rsp_frequency_argument, | ||
use_sim_time_argument, | ||
rsp_node, | ||
spawn_node, | ||
] | ||
) |