Skip to content

Commit

Permalink
Merge branch 'develop' into sync-master-1b0e66e
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicdarkoo authored Dec 26, 2024
2 parents 1b0e66e + 1442d78 commit b46a890
Show file tree
Hide file tree
Showing 44 changed files with 2,387 additions and 209 deletions.
2 changes: 1 addition & 1 deletion scripts/ci_before_init_embed.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ROS_DISTRO=$1

export TEST_WITH_WEBOTS_NIGTHLY=0
export WEBOTS_RELEASE_VERSION=2023b
export WEBOTS_RELEASE_VERSION=2024a
export WEBOTS_OFFSCREEN=1
export CI=1
export DEBIAN_FRONTEND=noninteractive
Expand Down
1 change: 1 addition & 0 deletions tests/sources/test_clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_sources_are_clang_format_compliant(self):
'webots_ros2_control',
'webots_ros2_driver',
'webots_ros2_epuck',
'webots_ros2_husarion',
'webots_ros2_importer',
'webots_ros2_mavic',
'webots_ros2_msgs',
Expand Down
5 changes: 4 additions & 1 deletion tests/sources/test_pep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
skippedDirectories = [
'.git',
'webots_ros2_importer/webots_ros2_importer/urdf2webots/',
'webots_ros2_driver/webots/lib'
'webots_ros2_driver/webots/lib',
'webots_ros2_husarion/rosbot_ros',
'webots_ros2_husarion/rosbot_xl_ros',
'webots_ros2_husarion/ros_components_description'
]
skippedDirectoriesFull = [os.path.join(ROOT_FOLDER, os.path.normpath(path)) for path in skippedDirectories]

Expand Down
4 changes: 4 additions & 0 deletions webots_ros2/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog for package webots_ros2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024.0.0 (2024-XX-XX)
------------------
* Created webots_ros2_husarion package.

2023.1.3 (2024-08-07)
------------------
* Added support for ROS 2 Jazzy.
Expand Down
72 changes: 72 additions & 0 deletions webots_ros2_crazyflie/launch/robot_launch.py
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())
],
)
)
])
22 changes: 22 additions & 0 deletions webots_ros2_crazyflie/package.xml
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>
17 changes: 17 additions & 0 deletions webots_ros2_crazyflie/resource/crazyflie_webots.urdf
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.
4 changes: 4 additions & 0 deletions webots_ros2_crazyflie/setup.cfg
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
32 changes: 32 additions & 0 deletions webots_ros2_crazyflie/setup.py
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.
Loading

0 comments on commit b46a890

Please sign in to comment.