-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into sync-master-1b0e66e
- Loading branch information
Showing
44 changed files
with
2,387 additions
and
209 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
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
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,72 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# ........... ____ _ __ | ||
# | ,-^-, | / __ )(_) /_______________ _____ ___ | ||
# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \ | ||
# | / ,..´ | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ | ||
# +....... /_____/_/\__/\___/_/ \__,_/ /___/\___/ | ||
|
||
# MIT License | ||
|
||
# Copyright (c) 2023 Bitcraze | ||
|
||
|
||
""" | ||
file: robot_launch.py | ||
Launch Webots Crazyflie ROS2 driver. | ||
Author: Kimberly McGuire (Bitcraze AB) | ||
""" | ||
|
||
|
||
import os | ||
import launch | ||
from launch.substitutions import LaunchConfiguration | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.substitutions.path_join_substitution import PathJoinSubstitution | ||
from launch import LaunchDescription | ||
from ament_index_python.packages import get_package_share_directory | ||
from webots_ros2_driver.webots_launcher import WebotsLauncher | ||
from webots_ros2_driver.webots_controller import WebotsController | ||
|
||
|
||
def generate_launch_description(): | ||
package_dir = get_package_share_directory('webots_ros2_crazyflie') | ||
world = LaunchConfiguration('world') | ||
|
||
webots = WebotsLauncher( | ||
world=PathJoinSubstitution([package_dir, 'worlds', world]), | ||
ros2_supervisor=True | ||
) | ||
|
||
robot_description_path = os.path.join( | ||
package_dir, 'resource', 'crazyflie_webots.urdf') | ||
crazyflie_driver = WebotsController( | ||
robot_name='Crazyflie', | ||
parameters=[ | ||
{'robot_description': robot_description_path}, | ||
], | ||
respawn=True | ||
) | ||
|
||
return LaunchDescription([ | ||
DeclareLaunchArgument( | ||
'world', | ||
default_value='crazyflie_apartment.wbt', | ||
description='Choose one of the world files from `/webots_ros2_crazyflie/worlds` directory' | ||
), | ||
webots, | ||
webots._supervisor, | ||
crazyflie_driver, | ||
|
||
# This action will kill all nodes once the Webots simulation has exited | ||
launch.actions.RegisterEventHandler( | ||
event_handler=launch.event_handlers.OnProcessExit( | ||
target_action=webots, | ||
on_exit=[ | ||
launch.actions.EmitEvent(event=launch.events.Shutdown()) | ||
], | ||
) | ||
) | ||
]) |
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,22 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>webots_ros2_crazyflie</name> | ||
<version>2023.1.1</version> | ||
<description>ROS2 package for Crazyflie webots simulator</description> | ||
<maintainer email="[email protected]">Kimberly McGuire (Bitcraze AB)</maintainer> | ||
<license>MIT</license> | ||
|
||
<exec_depend>rclpy</exec_depend> | ||
<exec_depend>builtin_interfaces</exec_depend> | ||
<exec_depend>webots_ros2_driver</exec_depend> | ||
|
||
<test_depend>ament_copyright</test_depend> | ||
<test_depend>ament_flake8</test_depend> | ||
<test_depend>ament_pep257</test_depend> | ||
<test_depend>python3-pytest</test_depend> | ||
|
||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
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,17 @@ | ||
<?xml version="1.0" ?> | ||
<robot name="Crazyflie Webots"> | ||
<webots> | ||
<device reference="gps" type="GPS"> | ||
<ros> | ||
<enabled>true</enabled> | ||
<alwaysOn>true</alwaysOn> | ||
</ros> | ||
</device> | ||
<device reference="camera" type="Camera"> | ||
<ros> | ||
<topicName>/camera</topicName> | ||
</ros> | ||
</device> | ||
<plugin type="webots_ros2_crazyflie.crazyflie_driver.CrazyflieDriver" /> | ||
</webots> | ||
</robot> |
Empty file.
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 @@ | ||
[develop] | ||
script_dir=$base/lib/webots_ros2_crazyflie | ||
[install] | ||
install_scripts=$base/lib/webots_ros2_crazyflie |
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,32 @@ | ||
from setuptools import find_packages, setup | ||
|
||
package_name = 'webots_ros2_crazyflie' | ||
data_files = [] | ||
data_files.append(('share/ament_index/resource_index/packages', ['resource/' + package_name])) | ||
data_files.append(('share/' + package_name + '/launch', ['launch/robot_launch.py'])) | ||
data_files.append(('share/' + package_name + '/worlds', [ | ||
'worlds/crazyflie_apartment.wbt', 'worlds/.crazyflie_apartment.wbproj', | ||
])) | ||
data_files.append(('share/' + package_name + '/resource', [ | ||
'resource/crazyflie_webots.urdf' | ||
])) | ||
data_files.append(('share/' + package_name, ['package.xml'])) | ||
|
||
setup( | ||
name=package_name, | ||
version='2023.1.1', | ||
packages=find_packages(exclude=['test']), | ||
data_files=data_files, | ||
install_requires=['setuptools', 'launch'], | ||
zip_safe=True, | ||
maintainer='Kimberly McGuire (Bitcraze AB)', | ||
maintainer_email='[email protected]', | ||
description='ROS2 package for Crazyflie webots simulator', | ||
license='MIT', | ||
tests_require=['pytest'], | ||
entry_points={ | ||
'console_scripts': [ | ||
'crazyflie_driver = webots_ros2_crazyflie.crazyflie_driver:main', | ||
], | ||
}, | ||
) |
Empty file.
Oops, something went wrong.