Skip to content

Commit cccf031

Browse files
authored
🔀 Release 0.1.0 (#4)
Signed-off-by: Luiz Carlos Cosmi Filho <luizcarloscosmifilho@gmail.com>
2 parents 36aff43 + 9227134 commit cccf031

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5370
-80
lines changed

.gitignore

Lines changed: 45 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ __pycache__/
33
*.py[cod]
44
*$py.class
55

6-
# C extensions
7-
*.so
8-
96
# Distribution / packaging
107
.Python
118
build/
@@ -27,16 +24,6 @@ share/python-wheels/
2724
*.egg
2825
MANIFEST
2926

30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
35-
36-
# Installer logs
37-
pip-log.txt
38-
pip-delete-this-directory.txt
39-
4027
# Unit test / coverage reports
4128
htmlcov/
4229
.tox/
@@ -51,56 +38,6 @@ coverage.xml
5138
.hypothesis/
5239
.pytest_cache/
5340

54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
target/
76-
77-
# Jupyter Notebook
78-
.ipynb_checkpoints
79-
80-
# IPython
81-
profile_default/
82-
ipython_config.py
83-
84-
# pyenv
85-
.python-version
86-
87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
93-
94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95-
__pypackages__/
96-
97-
# Celery stuff
98-
celerybeat-schedule
99-
celerybeat.pid
100-
101-
# SageMath parsed files
102-
*.sage.py
103-
10441
# Environments
10542
.env
10643
.venv
@@ -110,20 +47,48 @@ ENV/
11047
env.bak/
11148
venv.bak/
11249

113-
# Spyder project settings
114-
.spyderproject
115-
.spyproject
116-
117-
# Rope project settings
118-
.ropeproject
119-
120-
# mkdocs documentation
121-
/site
122-
123-
# mypy
124-
.mypy_cache/
125-
.dmypy.json
126-
dmypy.json
127-
128-
# Pyre type checker
129-
.pyre/
50+
# CMake
51+
CMakeLists.txt.user
52+
CMakeCache.txt
53+
CMakeFiles
54+
CMakeScripts
55+
Testing
56+
Makefile
57+
cmake_install.cmake
58+
install_manifest.txt
59+
compile_commands.json
60+
CTestTestfile.cmake
61+
_deps
62+
63+
# Prerequisites
64+
*.d
65+
66+
# Compiled Object files
67+
*.slo
68+
*.lo
69+
*.o
70+
*.obj
71+
72+
# Precompiled Headers
73+
*.gch
74+
*.pch
75+
76+
# Compiled Dynamic libraries
77+
*.so
78+
*.dylib
79+
*.dll
80+
81+
# Fortran module files
82+
*.mod
83+
*.smod
84+
85+
# Compiled Static libraries
86+
*.lai
87+
*.la
88+
*.a
89+
*.lib
90+
91+
# Executables
92+
*.exe
93+
*.out
94+
*.app

assignment-2/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(assignment-2)
3+
4+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
find_package(ament_cmake REQUIRED)
9+
10+
if(BUILD_TESTING)
11+
find_package(ament_lint_auto REQUIRED)
12+
set(ament_cmake_copyright_FOUND TRUE)
13+
set(ament_cmake_cpplint_FOUND TRUE)
14+
ament_lint_auto_find_test_dependencies()
15+
endif()
16+
17+
install(DIRECTORY launch
18+
DESTINATION share/${PROJECT_NAME}/
19+
)
20+
21+
ament_package()
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright 2023 Luiz Carlos Cosmi Filho and others.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
17+
from launch import LaunchDescription
18+
from launch.actions import IncludeLaunchDescription
19+
from launch.substitutions import LaunchConfiguration
20+
from ament_index_python.packages import get_package_share_directory
21+
from launch.launch_description_sources import PythonLaunchDescriptionSource
22+
23+
24+
def generate_launch_description():
25+
launch_file_dir_custom = os.path.join(get_package_share_directory('custom_worlds'), 'launch')
26+
launch_file_dir_random = os.path.join(get_package_share_directory('turtlebot3_random_bouncer'))
27+
use_sim_time = LaunchConfiguration('use_sim_time', default='true')
28+
x_pose = LaunchConfiguration('x_pose', default='0.0')
29+
y_pose = LaunchConfiguration('y_pose', default='-1.0')
30+
headless = LaunchConfiguration('headless', default='False')
31+
custom_worlds_cmd = IncludeLaunchDescription(
32+
PythonLaunchDescriptionSource(
33+
os.path.join(launch_file_dir_custom, 'custom_worlds.launch.py')
34+
),
35+
launch_arguments={
36+
'x_pose': x_pose,
37+
'y_pose': y_pose,
38+
'headless': headless,
39+
'use_sim_time': use_sim_time,
40+
}.items()
41+
)
42+
random_bouncer_cmd = IncludeLaunchDescription(
43+
PythonLaunchDescriptionSource(
44+
os.path.join(launch_file_dir_random, 'turtlebot3_random_bouncer.launch.py')
45+
),
46+
)
47+
ld = LaunchDescription()
48+
ld.add_action(custom_worlds_cmd)
49+
ld.add_action(random_bouncer_cmd)
50+
return ld

assignment-2/package.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>assignment-2</name>
5+
<version>0.1.0</version>
6+
<description>ROS packages for assignment-2 (metapackage)</description>
7+
<author email="luizcarloscosmifilho@gmail.com">Luiz Carlos Cosmi Filho</author>
8+
<maintainer email="luizcarloscosmifilho@gmail.com">Luiz Carlos Cosmi Filho</maintainer>
9+
<url type="repository">https://github.com/autonomous-robots/assignment-2</url>
10+
<url type="bugtracker">https://github.com/autonomous-robots/assignment-2/issues</url>
11+
<license>Apache License 2.0</license>
12+
<exec_depend>custom_worlds</exec_depend>
13+
<exec_depend>turtlebot3_random_bouncer</exec_depend>
14+
<exec_depend>yolov8_ros2</exec_depend>
15+
<buildtool_depend>ament_cmake</buildtool_depend>
16+
<test_depend>ament_lint_auto</test_depend>
17+
<test_depend>ament_lint_common</test_depend>
18+
<export>
19+
<build_type>ament_cmake</build_type>
20+
</export>
21+
</package>

custom_worlds/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(custom_worlds)
3+
4+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
find_package(ament_cmake REQUIRED)
9+
find_package(gazebo_ros_pkgs REQUIRED)
10+
11+
12+
if(BUILD_TESTING)
13+
find_package(ament_lint_auto REQUIRED)
14+
set(ament_cmake_copyright_FOUND TRUE)
15+
set(ament_cmake_cpplint_FOUND TRUE)
16+
ament_lint_auto_find_test_dependencies()
17+
endif()
18+
19+
install(DIRECTORY launch models worlds urdf
20+
DESTINATION share/${PROJECT_NAME}/
21+
)
22+
ament_export_dependencies(gazebo_ros_pkgs)
23+
ament_package()
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright 2023 Luiz Carlos Cosmi Filho and others.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
17+
from launch import LaunchDescription
18+
from launch.conditions import IfCondition
19+
from launch.actions import IncludeLaunchDescription
20+
from ament_index_python.packages import get_package_share_directory
21+
from launch.substitutions import LaunchConfiguration, PythonExpression
22+
from launch.launch_description_sources import PythonLaunchDescriptionSource
23+
24+
25+
def generate_launch_description():
26+
launch_file_dir_custom = os.path.join(get_package_share_directory('custom_worlds'), 'launch')
27+
28+
pkg_gazebo_ros = get_package_share_directory('gazebo_ros')
29+
pkg_custom_worlds = get_package_share_directory('custom_worlds')
30+
31+
use_sim_time = LaunchConfiguration('use_sim_time', default='true')
32+
x_pose = LaunchConfiguration('x_pose', default='0.0')
33+
y_pose = LaunchConfiguration('y_pose', default='-1.0')
34+
headless = LaunchConfiguration('headless', default='False')
35+
world_arg = LaunchConfiguration(
36+
'world',
37+
default=os.path.join(
38+
pkg_custom_worlds,
39+
"worlds",
40+
"custom_house2.world",
41+
),
42+
)
43+
44+
gzserver_cmd = IncludeLaunchDescription(
45+
PythonLaunchDescriptionSource(
46+
os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')
47+
),
48+
launch_arguments={'world': world_arg, 'verbose': 'true'}.items()
49+
)
50+
51+
gzclient_cmd = IncludeLaunchDescription(
52+
PythonLaunchDescriptionSource(
53+
os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py')
54+
),
55+
condition=IfCondition(
56+
PythonExpression(
57+
['not ', headless]
58+
)
59+
),
60+
)
61+
62+
robot_state_publisher_cmd = IncludeLaunchDescription(
63+
PythonLaunchDescriptionSource(
64+
os.path.join(launch_file_dir_custom, 'robot_state_publisher.launch.py')
65+
),
66+
launch_arguments={'use_sim_time': use_sim_time}.items()
67+
)
68+
69+
spawn_turtlebot_cmd = IncludeLaunchDescription(
70+
PythonLaunchDescriptionSource(
71+
os.path.join(launch_file_dir_custom, 'spawn_turtlebot3.launch.py')
72+
),
73+
launch_arguments={
74+
'x_pose': x_pose,
75+
'y_pose': y_pose
76+
}.items()
77+
)
78+
79+
ld = LaunchDescription()
80+
81+
# Add the commands to the launch description
82+
ld.add_action(gzserver_cmd)
83+
ld.add_action(gzclient_cmd)
84+
ld.add_action(robot_state_publisher_cmd)
85+
ld.add_action(spawn_turtlebot_cmd)
86+
87+
return ld

0 commit comments

Comments
 (0)