Migrate to a new physical robot

Uses the mecanum controller properly across physical and virtual
There is a timing issue with i2c which is why the control update is limited to 10hz
The sonar and LED's arent yet working, this will come soon.
This commit is contained in:
2026-05-27 13:25:20 +00:00
parent c1319a6357
commit ec554bcf2c
96 changed files with 2874 additions and 3730 deletions
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.8)
project(raspbot_v2_bringup)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()
+17
View File
@@ -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.
@@ -0,0 +1,80 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node, PushRosNamespace
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
namespace = LaunchConfiguration('namespace')
enable_camera = LaunchConfiguration('enable_camera')
enable_lidar = LaunchConfiguration('enable_lidar')
enable_sonar = LaunchConfiguration('enable_sonar')
use_sim_time = LaunchConfiguration('use_sim_time')
use_hardware = LaunchConfiguration('use_hardware')
declared_args = [
DeclareLaunchArgument(
'namespace', default_value='',
description='ROS namespace for all robot nodes (e.g. "robot1").'
),
DeclareLaunchArgument(
'use_sim_time', default_value='false',
description='Use simulation time.'
),
DeclareLaunchArgument(
'use_hardware', default_value='false',
description='Use hardware nodes.'
),
DeclareLaunchArgument(
'enable_camera', default_value='true',
description='Enable the camera node.'
),
DeclareLaunchArgument(
'enable_lidar', default_value='true',
description='Enable the LiDAR node.'
),
DeclareLaunchArgument(
'enable_sonar', default_value='true',
description='Enable the sonar node.'
)
]
controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
PathJoinSubstitution([
FindPackageShare('raspbot_v2_control'), 'launch', 'controller_manager.launch.py'
])
]),
launch_arguments={
'namespace': namespace,
'use_sim_time': LaunchConfiguration('use_sim_time')
}.items()
)
hardware_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
PathJoinSubstitution([
FindPackageShare('raspbot_v2_hardware'), 'launch', 'hardware.launch.py'
]),
]),
condition=IfCondition(use_hardware),
launch_arguments={
'namespace': namespace,
}.items(),
)
return LaunchDescription([
*declared_args,
PushRosNamespace(namespace),
controller_launch,
hardware_launch,
])
@@ -0,0 +1,18 @@
<?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>raspbot_v2_bringup</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="matthew@thespencers.me.uk">Matt Spencer</maintainer>
<license>MIT</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>