-
Notifications
You must be signed in to change notification settings - Fork 23
Implement launch files #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2122d97
Started integration of launch files and updated dockerfile to properl…
evan-palmer f22776a
precommit
evan-palmer 51b8400
Added message interval client
evan-palmer c417c43
Added vision pose plugin
evan-palmer 6493d46
Added docstrings
evan-palmer 9e07fea
Fixed pr comments
evan-palmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ | |
| !blue_manager | ||
| !blue_control | ||
| !blue_msgs | ||
| !blue_bringup | ||
This file contains hidden or 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 @@ | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
Empty file.
This file contains hidden or 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,50 @@ | ||
| blue_manager: | ||
| ros__parameters: | ||
| num_thrusters: 8 | ||
| mode_change_timeout: 1.0 | ||
| mode_change_retries: 3 | ||
|
|
||
| ismc: | ||
| ros__parameters: | ||
| mass: 11.5 | ||
| buoyancy: 112.80 | ||
| weight: 114.80 | ||
| inertia_tensor_coeff: [0.16, 0.16, 0.16] | ||
| added_mass_coeff: [-5.50, -12.70, -14.60, -0.12, -0.12, -0.12] | ||
| linear_damping_coeff: [-4.03, -6.22, -5.18, -0.07, -0.07, -0.07] | ||
| quadratic_damping_coeff: [-18.18, -21.66, -36.99, -1.55, -1.55, -1.55] | ||
| center_of_gravity: [0.0, 0.0, 0.0] | ||
| center_of_buoyancy: [0.0, 0.0, 0.0] | ||
| ocean_current: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | ||
| num_thrusters: 8 | ||
| tcm: [0.707, 0.707, -0.707, -0.707, 0.0, 0.0, 0.0, 0.0, | ||
| -0.707, 0.707, -0.707, 0.707, 0.0, 0.0, 0.0, 0.0, | ||
| 0.0, 0.0, 0.0, 0.0, -1.0, 1.0, 1.0, -1.0, | ||
| 0.06, -0.06, 0.06, -0.06, -0.218, -0.218, 0.218, 0.218, | ||
| 0.06, 0.06, -0.06, -0.06, 0.120, -0.120, 0.120, -0.120, | ||
| -0.1888, 0.1888, 0.1888, -0.1888, 0.0, 0.0, 0.0, 0.0] | ||
| msg_ids: [31, 32] | ||
| msg_rates: [100.0, 100.0] | ||
|
|
||
| mavros: | ||
| ros__parameters: | ||
| system_id: 255 | ||
| plugin_allowlist: | ||
| - sys_status | ||
| - command | ||
| - imu | ||
| - local_position | ||
| - rc_io | ||
| - param | ||
| - vision_pose | ||
|
|
||
| mavros_node: | ||
| ros__parameters: | ||
| fcu_url: "tcp://localhost" | ||
| gcs_url: "udp://@localhost:14550" | ||
|
|
||
| mavros/local_position: | ||
| ros__parameters: | ||
| frame_id: "map" | ||
| tf: | ||
| send: false |
This file contains hidden or 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,93 @@ | ||
| # Copyright 2023, Evan Palmer | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to deal | ||
| # in the Software without restriction, including without limitation the rights | ||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
|
|
||
| # The above copyright notice and this permission notice shall be included in | ||
| # all copies or substantial portions of the Software. | ||
|
|
||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| # THE SOFTWARE. | ||
|
|
||
| from launch import LaunchDescription | ||
| from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
| from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
| from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
| from launch_ros.actions import Node | ||
| from launch_ros.substitutions import FindPackageShare | ||
|
|
||
|
|
||
| def generate_launch_description() -> LaunchDescription: | ||
| """Generate a launch description to run the system. | ||
|
|
||
| Returns: | ||
| The Blue ROS 2 launch description. | ||
| """ | ||
| # Declare the launch arguments | ||
| args = [ | ||
| DeclareLaunchArgument( | ||
| "config", | ||
| default_value="blue.yaml", | ||
| description="The ROS 2 parameters configuration file", | ||
| ), | ||
| DeclareLaunchArgument( | ||
| "controller", | ||
| default_value="ismc", | ||
| description=( | ||
| "The controller to use; this should be the same name as the" | ||
| " controller's executable" | ||
| ), | ||
| choices=["ismc"], | ||
| ), | ||
| ] | ||
|
|
||
| config_filepath = PathJoinSubstitution( | ||
| [ | ||
| FindPackageShare("blue_bringup"), | ||
| "config", | ||
| LaunchConfiguration("config"), | ||
| ] | ||
| ) | ||
|
|
||
| nodes = [ | ||
| Node( | ||
| package="mavros", | ||
| executable="mavros_node", | ||
| output="screen", | ||
| parameters=[config_filepath], | ||
| ), | ||
| ] | ||
|
|
||
| # Declare additional launch files to run | ||
| includes = [ | ||
| IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource( | ||
| PathJoinSubstitution( | ||
| [FindPackageShare("blue_manager"), "manager.launch.py"] | ||
| ) | ||
| ), | ||
| launch_arguments={"config_filepath": config_filepath}.items(), | ||
| ), | ||
| IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource( | ||
| PathJoinSubstitution( | ||
| [FindPackageShare("blue_control"), "launch", "control.launch.py"] | ||
| ) | ||
| ), | ||
| launch_arguments={ | ||
| "config_filepath": config_filepath, | ||
| "controller": LaunchConfiguration("controller"), | ||
| }.items(), | ||
| ), | ||
| ] | ||
|
|
||
| return LaunchDescription(args + nodes + includes) |
This file contains hidden or 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,21 @@ | ||
| <?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>blue_bringup</name> | ||
| <version>0.0.1</version> | ||
| <description>Entrypoints for the Blue project.</description> | ||
| <maintainer email="evanp922@gmail.com">Evan Palmer</maintainer> | ||
| <license>MIT</license> | ||
|
|
||
| <exec_depend>mavros</exec_depend> | ||
| <exec_depend>mavros_extras</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> |
Empty file.
This file contains hidden or 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/blue_bringup | ||
| [install] | ||
| install_scripts=$base/lib/blue_bringup |
This file contains hidden or 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,48 @@ | ||
| # Copyright 2023, Evan Palmer | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to deal | ||
| # in the Software without restriction, including without limitation the rights | ||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
|
|
||
| # The above copyright notice and this permission notice shall be included in | ||
| # all copies or substantial portions of the Software. | ||
|
|
||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| # THE SOFTWARE. | ||
|
|
||
| import os | ||
| from glob import glob | ||
|
|
||
| from setuptools import setup | ||
|
|
||
| package_name = "blue_bringup" | ||
|
|
||
| setup( | ||
| name=package_name, | ||
| version="0.0.1", | ||
| packages=[package_name], | ||
| data_files=[ | ||
| ("share/ament_index/resource_index/packages", ["resource/" + package_name]), | ||
| ("share/" + package_name, ["package.xml"]), | ||
| (os.path.join("share", package_name), glob("launch/*.launch.py")), | ||
| (os.path.join("share", package_name, "config"), glob("config/*.yaml")), | ||
| ], | ||
| install_requires=["setuptools"], | ||
| zip_safe=True, | ||
| maintainer="Evan Palmer", | ||
| maintainer_email="evanp922@gmail.com", | ||
| description="Entrypoints for the Blue project.", | ||
| license="MIT", | ||
| tests_require=["pytest"], | ||
| entry_points={ | ||
| "console_scripts": [], | ||
| }, | ||
| ) |
This file contains hidden or 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 @@ | ||
| # Copyright 2015 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import pytest | ||
| from ament_copyright.main import main | ||
|
|
||
|
|
||
| # Remove the `skip` decorator once the source file(s) have a copyright header | ||
| @pytest.mark.skip( | ||
| reason="No copyright header has been placed in the generated source file." | ||
| ) | ||
| @pytest.mark.copyright | ||
| @pytest.mark.linter | ||
| def test_copyright(): | ||
| rc = main(argv=[".", "test"]) | ||
| assert rc == 0, "Found errors" |
This file contains hidden or 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,25 @@ | ||
| # Copyright 2017 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import pytest | ||
| from ament_flake8.main import main_with_errors | ||
|
|
||
|
|
||
| @pytest.mark.flake8 | ||
| @pytest.mark.linter | ||
| def test_flake8(): | ||
| rc, errors = main_with_errors(argv=[]) | ||
| assert rc == 0, "Found %d code style errors / warnings:\n" % len( | ||
| errors | ||
| ) + "\n".join(errors) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.