From 27bdee4a7a59e67c43de33f05f34d267a5e50628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EC=B0=BD=ED=9B=88?= Date: Tue, 28 Jul 2026 10:35:32 +0900 Subject: [PATCH] feat: add lms-nav2-gazebo-vehicle module --- .gitignore | 5 + build.sh | 6 + run.sh | 8 + src/autoware_auto_msgs/COLCON_IGNORE | 0 src/autoware_auto_msgs/DISCLAIMER.md | 50 ++ src/autoware_auto_msgs/LICENSE | 201 +++++++ src/autoware_auto_msgs/README.md | 77 +++ .../autoware_auto_control_msgs/CMakeLists.txt | 26 + .../msg/AckermannControlCommand.idl | 16 + .../msg/AckermannLateralCommand.idl | 25 + .../msg/HighLevelControlCommand.idl | 18 + .../msg/LongitudinalCommand.idl | 30 + .../autoware_auto_control_msgs/package.xml | 27 + .../CMakeLists.txt | 26 + .../msg/Complex32.idl | 20 + .../msg/Quaternion32.idl | 19 + .../RelativePositionWithCovarianceStamped.idl | 16 + .../autoware_auto_geometry_msgs/package.xml | 28 + .../autoware_auto_mapping_msgs/CMakeLists.txt | 26 + .../msg/HADMapBin.idl | 32 ++ .../msg/HADMapSegment.idl | 12 + .../msg/MapPrimitive.idl | 17 + .../autoware_auto_mapping_msgs/package.xml | 27 + .../srv/HADMapService.idl | 39 ++ .../autoware_auto_msgs/CHANGELOG.rst | 57 ++ .../autoware_auto_msgs/CMakeLists.txt | 16 + .../autoware_auto_internal_msgs-design.md | 67 +++ .../design/autoware_auto_msgs-design.md | 513 ++++++++++++++++++ .../design/bounding-box-design.md | 224 ++++++++ .../autoware_auto_msgs/package.xml | 27 + .../CMakeLists.txt | 52 ++ .../msg/BoundingBox.idl | 71 +++ .../msg/BoundingBoxArray.idl | 17 + .../msg/ClassifiedRoi.idl | 15 + .../msg/ClassifiedRoiArray.idl | 14 + .../msg/DetectedObject.idl | 16 + .../msg/DetectedObjectKinematics.idl | 42 ++ .../msg/DetectedObjects.idl | 13 + .../msg/LookingTrafficSignal.idl | 14 + .../msg/ObjectClassification.idl | 24 + .../msg/PointClusters.idl | 18 + .../msg/PointXYZIF.idl | 20 + .../msg/PredictedObject.idl | 20 + .../msg/PredictedObjectKinematics.idl | 18 + .../msg/PredictedObjects.idl | 13 + .../msg/PredictedPath.idl | 15 + .../msg/Shape.idl | 27 + .../msg/TrackedObject.idl | 20 + .../msg/TrackedObjectKinematics.idl | 46 ++ .../msg/TrackedObjects.idl | 13 + .../msg/TrafficLight.idl | 44 ++ .../msg/TrafficLightRoi.idl | 10 + .../msg/TrafficLightRoiArray.idl | 11 + .../msg/TrafficSignal.idl | 19 + .../msg/TrafficSignalArray.idl | 11 + .../msg/TrafficSignalStamped.idl | 11 + .../msg/TrafficSignalWithJudge.idl | 17 + .../autoware_auto_perception_msgs/package.xml | 31 ++ .../CMakeLists.txt | 42 ++ .../action/PlanTrajectory.idl | 27 + .../action/PlannerCostmap.idl | 26 + .../action/RecordTrajectory.idl | 19 + .../action/ReplayTrajectory.idl | 19 + .../msg/HADMapRoute.idl | 27 + .../msg/OrderMovement.idl | 21 + .../autoware_auto_planning_msgs/msg/Path.idl | 16 + .../msg/PathPoint.idl | 26 + .../msg/PathPointWithLaneId.idl | 15 + .../msg/PathWithLaneId.idl | 16 + .../autoware_auto_planning_msgs/msg/Route.idl | 22 + .../msg/Trajectory.idl | 17 + .../msg/TrajectoryPoint.idl | 33 ++ .../autoware_auto_planning_msgs/package.xml | 33 ++ .../srv/ModifyTrajectory.idl | 18 + .../autoware_auto_system_msgs/CMakeLists.txt | 31 ++ .../msg/AutowareState.idl | 26 + .../msg/ControlDiagnostic.idl | 33 ++ .../msg/DiagnosticHeader.idl | 20 + .../msg/DrivingCapability.idl | 22 + .../msg/EmergencyState.idl | 30 + .../msg/HazardStatus.idl | 49 ++ .../msg/HazardStatusStamped.idl | 18 + .../autoware_auto_system_msgs/package.xml | 29 + .../autoware_auto_vehicle_msgs/CMakeLists.txt | 53 ++ .../msg/ControlModeCommand.idl | 19 + .../msg/ControlModeReport.idl | 24 + .../autoware_auto_vehicle_msgs/msg/Engage.idl | 18 + .../msg/GearCommand.idl | 40 ++ .../msg/GearReport.idl | 40 ++ .../msg/HandBrakeCommand.idl | 16 + .../msg/HandBrakeReport.idl | 13 + .../msg/HazardLightsCommand.idl | 22 + .../msg/HazardLightsReport.idl | 18 + .../msg/HeadlightsCommand.idl | 23 + .../msg/HeadlightsReport.idl | 18 + .../msg/HornCommand.idl | 16 + .../msg/HornReport.idl | 13 + .../msg/RawControlCommand.idl | 21 + .../msg/StationaryLockingCommand.idl | 20 + .../msg/SteeringReport.idl | 17 + .../msg/TurnIndicatorsCommand.idl | 23 + .../msg/TurnIndicatorsReport.idl | 19 + .../msg/VehicleControlCommand.idl | 27 + .../msg/VehicleKinematicState.idl | 18 + .../msg/VehicleOdometry.idl | 20 + .../msg/VehicleStateCommand.idl | 57 ++ .../msg/VehicleStateReport.idl | 50 ++ .../msg/VelocityReport.idl | 20 + .../msg/WheelEncoder.idl | 17 + .../msg/WipersCommand.idl | 38 ++ .../msg/WipersReport.idl | 34 ++ .../autoware_auto_vehicle_msgs/package.xml | 29 + .../srv/AutonomyModeChange.idl | 22 + .../srv/ControlModeCommand.srv | 12 + src/autoware_auto_msgs/build_depends.repos | 1 + src/novatel_oem7_msgs/CHANGELOG.rst | 23 + src/novatel_oem7_msgs/CMakeLists.txt | 70 +++ src/novatel_oem7_msgs/msg/AccessStatus.msg | 5 + src/novatel_oem7_msgs/msg/BESTGNSSPOS.msg | 23 + src/novatel_oem7_msgs/msg/BESTGNSSVEL.msg | 10 + src/novatel_oem7_msgs/msg/BESTPOS.msg | 29 + src/novatel_oem7_msgs/msg/BESTUTM.msg | 26 + src/novatel_oem7_msgs/msg/BESTVEL.msg | 11 + .../msg/BestExtendedSolutionStatus.msg | 26 + src/novatel_oem7_msgs/msg/CORRIMU.msg | 11 + src/novatel_oem7_msgs/msg/GeogatingStatus.msg | 9 + src/novatel_oem7_msgs/msg/HEADING2.msg | 24 + src/novatel_oem7_msgs/msg/IMURATECORRIMU.msg | 10 + .../msg/INSAlignmentMode.msg | 9 + src/novatel_oem7_msgs/msg/INSCONFIG.msg | 33 ++ .../msg/INSExtendedSolutionStatus.msg | 56 ++ src/novatel_oem7_msgs/msg/INSFrame.msg | 4 + src/novatel_oem7_msgs/msg/INSOutputFrame.msg | 7 + src/novatel_oem7_msgs/msg/INSPVA.msg | 12 + src/novatel_oem7_msgs/msg/INSPVAX.msg | 25 + .../msg/INSReceiverStatus.msg | 10 + src/novatel_oem7_msgs/msg/INSResetType.msg | 21 + src/novatel_oem7_msgs/msg/INSSTDEV.msg | 16 + src/novatel_oem7_msgs/msg/INSSourceStatus.msg | 11 + src/novatel_oem7_msgs/msg/INSUpdate.msg | 4 + .../msg/InertialSolutionStatus.msg | 14 + src/novatel_oem7_msgs/msg/LocalAreaStatus.msg | 9 + src/novatel_oem7_msgs/msg/Oem7Header.msg | 13 + src/novatel_oem7_msgs/msg/Oem7RawMsg.msg | 3 + src/novatel_oem7_msgs/msg/PPPPOS.msg | 29 + .../msg/PositionOrVelocityType.msg | 33 ++ src/novatel_oem7_msgs/msg/RAWIMUSX.msg | 13 + src/novatel_oem7_msgs/msg/RXSTATUS.msg | 36 ++ .../msg/RegionRestriction.msg | 6 + src/novatel_oem7_msgs/msg/Rotation.msg | 9 + .../msg/RotationalOffset.msg | 10 + src/novatel_oem7_msgs/msg/SolutionSource.msg | 9 + src/novatel_oem7_msgs/msg/SolutionStatus.msg | 17 + .../msg/SubscriptionPermission.msg | 11 + .../msg/SubscriptionType.msg | 8 + src/novatel_oem7_msgs/msg/SyncState.msg | 6 + src/novatel_oem7_msgs/msg/TERRASTARINFO.msg | 19 + src/novatel_oem7_msgs/msg/TERRASTARSTATUS.msg | 13 + src/novatel_oem7_msgs/msg/TIME.msg | 16 + src/novatel_oem7_msgs/msg/Translation.msg | 9 + .../msg/TranslationOffset.msg | 11 + src/novatel_oem7_msgs/package.xml | 27 + src/novatel_oem7_msgs/srv/Oem7AbasciiCmd.srv | 4 + src/vehicle_pkg/config/fr09-carla/hero.json | 63 +++ src/vehicle_pkg/config/fr09-carla/imu.json | 35 ++ .../config/fr09-carla/ouster_lidar.json | 33 ++ .../config/fr09-carla/vanjee_lidar.json | 33 ++ src/vehicle_pkg/config/mkmini-carla/hero.json | 63 +++ src/vehicle_pkg/config/mkmini-carla/imu.json | 35 ++ .../config/mkmini-carla/ouster_lidar.json | 33 ++ .../config/mkmini-carla/vanjee_lidar.json | 34 ++ .../config/platforms/platform_f1tenth.yaml | 28 + .../config/platforms/platform_fr09.yaml | 26 + .../config/platforms/platform_mkmini.yaml | 33 ++ .../config/platforms/platform_turtlebot3.yaml | 24 + .../config/sensor_bridge_carla.yaml | 13 + .../config/sensor_bridge_fr09.yaml | 14 + .../config/sensor_bridge_mkmini.yaml | 13 + .../sensor_driver_carla_lidar.yaml | 30 + .../sensor_driver_fr09_autoware.yaml | 30 + .../sensor_driver_gazebo_laserscan.yaml | 13 + .../vehicle_driver_carla_ackermann.yaml | 26 + .../vehicle_driver_fr09_tod.yaml | 25 + .../vehicle_driver_gazebo_passthrough.yaml | 9 + src/vehicle_pkg/config/vehicle_fr09.yaml | 26 + src/vehicle_pkg/config/vehicle_mkmini.yaml | 29 + .../vehicle.launch.cpython-310.pyc | Bin 0 -> 3178 bytes .../launch/carla_spawn_hero.launch.py | 132 +++++ .../launch/carla_spawn_sensor.launch.py | 37 ++ .../launch/carla_spawn_vehicle.launch.py | 44 ++ src/vehicle_pkg/launch/vehicle.launch.py | 159 ++++++ src/vehicle_pkg/package.xml | 22 + src/vehicle_pkg/resource/vehicle_pkg | 0 src/vehicle_pkg/setup.cfg | 4 + src/vehicle_pkg/setup.py | 48 ++ src/vehicle_pkg/test/test_copyright.py | 25 + src/vehicle_pkg/test/test_flake8.py | 25 + src/vehicle_pkg/test/test_pep257.py | 23 + .../test/test_perception_decode.py | 24 + src/vehicle_pkg/test/test_profiles.py | 157 ++++++ src/vehicle_pkg/vehicle_pkg/__init__.py | 0 .../__pycache__/profiles.cpython-310.pyc | Bin 0 -> 5931 bytes .../vehicle_pkg/cmd_vel_to_ackermann.py | 96 ++++ .../cmd_vel_to_ackermann_stamped.py | 96 ++++ src/vehicle_pkg/vehicle_pkg/cmd_vel_to_tod.py | 86 +++ src/vehicle_pkg/vehicle_pkg/perception_arg.py | 16 + src/vehicle_pkg/vehicle_pkg/profiles.py | 172 ++++++ src/vehicle_pkg/vehicle_pkg/pub_clock.py | 48 ++ .../vehicle_pkg/pub_vehicle_config.py | 75 +++ src/vehicle_pkg/vehicle_pkg/registry.py | 48 ++ src/vehicle_pkg/vehicle_pkg/sensor_bridge.py | 139 +++++ src/vehicle_pkg/vehicle_pkg/test.py | 6 + src/vehicle_pkg/vehicle_pkg/wasd_teleop.py | 157 ++++++ src/vehicle_pkg/vehicle_pkg/wasd_teleop_pg.py | 150 +++++ 214 files changed, 6977 insertions(+) create mode 100644 .gitignore create mode 100755 build.sh create mode 100755 run.sh create mode 100755 src/autoware_auto_msgs/COLCON_IGNORE create mode 100755 src/autoware_auto_msgs/DISCLAIMER.md create mode 100755 src/autoware_auto_msgs/LICENSE create mode 100755 src/autoware_auto_msgs/README.md create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannControlCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannLateralCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/msg/HighLevelControlCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/msg/LongitudinalCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_control_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_geometry_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Complex32.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Quaternion32.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/RelativePositionWithCovarianceStamped.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_geometry_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapBin.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapSegment.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/MapPrimitive.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_mapping_msgs/srv/HADMapService.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/CHANGELOG.rst create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_internal_msgs-design.md create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_msgs-design.md create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/design/bounding-box-design.md create mode 100755 src/autoware_auto_msgs/autoware_auto_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBox.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBoxArray.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoi.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoiArray.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObject.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjectKinematics.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjects.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/LookingTrafficSignal.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ObjectClassification.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointClusters.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointXYZIF.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObject.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjectKinematics.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjects.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedPath.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/Shape.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObject.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjectKinematics.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjects.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLight.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoi.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoiArray.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignal.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalArray.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalStamped.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalWithJudge.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_perception_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlanTrajectory.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlannerCostmap.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/action/RecordTrajectory.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/action/ReplayTrajectory.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/HADMapRoute.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/OrderMovement.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Path.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPoint.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPointWithLaneId.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathWithLaneId.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Route.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Trajectory.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/TrajectoryPoint.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_planning_msgs/srv/ModifyTrajectory.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/AutowareState.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/ControlDiagnostic.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DiagnosticHeader.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DrivingCapability.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/EmergencyState.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatus.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatusStamped.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_system_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/CMakeLists.txt create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/Engage.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/RawControlCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/StationaryLockingCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/SteeringReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleControlCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleKinematicState.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleOdometry.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VelocityReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WheelEncoder.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersCommand.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersReport.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/package.xml create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/AutonomyModeChange.idl create mode 100755 src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/ControlModeCommand.srv create mode 100755 src/autoware_auto_msgs/build_depends.repos create mode 100755 src/novatel_oem7_msgs/CHANGELOG.rst create mode 100755 src/novatel_oem7_msgs/CMakeLists.txt create mode 100755 src/novatel_oem7_msgs/msg/AccessStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/BESTGNSSPOS.msg create mode 100755 src/novatel_oem7_msgs/msg/BESTGNSSVEL.msg create mode 100755 src/novatel_oem7_msgs/msg/BESTPOS.msg create mode 100755 src/novatel_oem7_msgs/msg/BESTUTM.msg create mode 100755 src/novatel_oem7_msgs/msg/BESTVEL.msg create mode 100755 src/novatel_oem7_msgs/msg/BestExtendedSolutionStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/CORRIMU.msg create mode 100755 src/novatel_oem7_msgs/msg/GeogatingStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/HEADING2.msg create mode 100755 src/novatel_oem7_msgs/msg/IMURATECORRIMU.msg create mode 100755 src/novatel_oem7_msgs/msg/INSAlignmentMode.msg create mode 100755 src/novatel_oem7_msgs/msg/INSCONFIG.msg create mode 100755 src/novatel_oem7_msgs/msg/INSExtendedSolutionStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/INSFrame.msg create mode 100755 src/novatel_oem7_msgs/msg/INSOutputFrame.msg create mode 100755 src/novatel_oem7_msgs/msg/INSPVA.msg create mode 100755 src/novatel_oem7_msgs/msg/INSPVAX.msg create mode 100755 src/novatel_oem7_msgs/msg/INSReceiverStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/INSResetType.msg create mode 100755 src/novatel_oem7_msgs/msg/INSSTDEV.msg create mode 100755 src/novatel_oem7_msgs/msg/INSSourceStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/INSUpdate.msg create mode 100755 src/novatel_oem7_msgs/msg/InertialSolutionStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/LocalAreaStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/Oem7Header.msg create mode 100755 src/novatel_oem7_msgs/msg/Oem7RawMsg.msg create mode 100755 src/novatel_oem7_msgs/msg/PPPPOS.msg create mode 100755 src/novatel_oem7_msgs/msg/PositionOrVelocityType.msg create mode 100755 src/novatel_oem7_msgs/msg/RAWIMUSX.msg create mode 100755 src/novatel_oem7_msgs/msg/RXSTATUS.msg create mode 100755 src/novatel_oem7_msgs/msg/RegionRestriction.msg create mode 100755 src/novatel_oem7_msgs/msg/Rotation.msg create mode 100755 src/novatel_oem7_msgs/msg/RotationalOffset.msg create mode 100755 src/novatel_oem7_msgs/msg/SolutionSource.msg create mode 100755 src/novatel_oem7_msgs/msg/SolutionStatus.msg create mode 100755 src/novatel_oem7_msgs/msg/SubscriptionPermission.msg create mode 100755 src/novatel_oem7_msgs/msg/SubscriptionType.msg create mode 100755 src/novatel_oem7_msgs/msg/SyncState.msg create mode 100755 src/novatel_oem7_msgs/msg/TERRASTARINFO.msg create mode 100755 src/novatel_oem7_msgs/msg/TERRASTARSTATUS.msg create mode 100755 src/novatel_oem7_msgs/msg/TIME.msg create mode 100755 src/novatel_oem7_msgs/msg/Translation.msg create mode 100755 src/novatel_oem7_msgs/msg/TranslationOffset.msg create mode 100755 src/novatel_oem7_msgs/package.xml create mode 100755 src/novatel_oem7_msgs/srv/Oem7AbasciiCmd.srv create mode 100755 src/vehicle_pkg/config/fr09-carla/hero.json create mode 100755 src/vehicle_pkg/config/fr09-carla/imu.json create mode 100755 src/vehicle_pkg/config/fr09-carla/ouster_lidar.json create mode 100755 src/vehicle_pkg/config/fr09-carla/vanjee_lidar.json create mode 100755 src/vehicle_pkg/config/mkmini-carla/hero.json create mode 100755 src/vehicle_pkg/config/mkmini-carla/imu.json create mode 100755 src/vehicle_pkg/config/mkmini-carla/ouster_lidar.json create mode 100755 src/vehicle_pkg/config/mkmini-carla/vanjee_lidar.json create mode 100755 src/vehicle_pkg/config/platforms/platform_f1tenth.yaml create mode 100755 src/vehicle_pkg/config/platforms/platform_fr09.yaml create mode 100755 src/vehicle_pkg/config/platforms/platform_mkmini.yaml create mode 100644 src/vehicle_pkg/config/platforms/platform_turtlebot3.yaml create mode 100755 src/vehicle_pkg/config/sensor_bridge_carla.yaml create mode 100755 src/vehicle_pkg/config/sensor_bridge_fr09.yaml create mode 100755 src/vehicle_pkg/config/sensor_bridge_mkmini.yaml create mode 100755 src/vehicle_pkg/config/sensor_drivers/sensor_driver_carla_lidar.yaml create mode 100755 src/vehicle_pkg/config/sensor_drivers/sensor_driver_fr09_autoware.yaml create mode 100644 src/vehicle_pkg/config/sensor_drivers/sensor_driver_gazebo_laserscan.yaml create mode 100755 src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_carla_ackermann.yaml create mode 100755 src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_fr09_tod.yaml create mode 100644 src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_gazebo_passthrough.yaml create mode 100755 src/vehicle_pkg/config/vehicle_fr09.yaml create mode 100755 src/vehicle_pkg/config/vehicle_mkmini.yaml create mode 100644 src/vehicle_pkg/launch/__pycache__/vehicle.launch.cpython-310.pyc create mode 100755 src/vehicle_pkg/launch/carla_spawn_hero.launch.py create mode 100755 src/vehicle_pkg/launch/carla_spawn_sensor.launch.py create mode 100755 src/vehicle_pkg/launch/carla_spawn_vehicle.launch.py create mode 100755 src/vehicle_pkg/launch/vehicle.launch.py create mode 100755 src/vehicle_pkg/package.xml create mode 100755 src/vehicle_pkg/resource/vehicle_pkg create mode 100755 src/vehicle_pkg/setup.cfg create mode 100755 src/vehicle_pkg/setup.py create mode 100755 src/vehicle_pkg/test/test_copyright.py create mode 100755 src/vehicle_pkg/test/test_flake8.py create mode 100755 src/vehicle_pkg/test/test_pep257.py create mode 100755 src/vehicle_pkg/test/test_perception_decode.py create mode 100755 src/vehicle_pkg/test/test_profiles.py create mode 100755 src/vehicle_pkg/vehicle_pkg/__init__.py create mode 100644 src/vehicle_pkg/vehicle_pkg/__pycache__/profiles.cpython-310.pyc create mode 100755 src/vehicle_pkg/vehicle_pkg/cmd_vel_to_ackermann.py create mode 100755 src/vehicle_pkg/vehicle_pkg/cmd_vel_to_ackermann_stamped.py create mode 100755 src/vehicle_pkg/vehicle_pkg/cmd_vel_to_tod.py create mode 100755 src/vehicle_pkg/vehicle_pkg/perception_arg.py create mode 100755 src/vehicle_pkg/vehicle_pkg/profiles.py create mode 100755 src/vehicle_pkg/vehicle_pkg/pub_clock.py create mode 100755 src/vehicle_pkg/vehicle_pkg/pub_vehicle_config.py create mode 100755 src/vehicle_pkg/vehicle_pkg/registry.py create mode 100755 src/vehicle_pkg/vehicle_pkg/sensor_bridge.py create mode 100755 src/vehicle_pkg/vehicle_pkg/test.py create mode 100755 src/vehicle_pkg/vehicle_pkg/wasd_teleop.py create mode 100755 src/vehicle_pkg/vehicle_pkg/wasd_teleop_pg.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76b3365 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +build/ +install/ +log/ +.colcon/ +*.log diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0c1c5bc --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +MODULE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +RUNTIME_ROOT="${AUTONOMY_STUDIO_RUNTIME_ROOT:-$HOME/autonomy-studio/runtime/nav2}" +exec bash "$RUNTIME_ROOT/docker/docker_build_nav2.sh" "$(dirname "$MODULE_PATH")" "$(basename "$MODULE_PATH")" "${NAV2_DOCKER_IMAGE:-future-nav2-gazebo:humble}" "${ROS_DOMAIN_ID:-0}" diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..b0fc3a4 --- /dev/null +++ b/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +MODULE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +RUNTIME_ROOT="${AUTONOMY_STUDIO_RUNTIME_ROOT:-$HOME/autonomy-studio/runtime/nav2}" +FOLDER_NAME="$(basename "$MODULE_PATH")" +CONTAINER_NAME="${FOLDER_NAME#\[}"; CONTAINER_NAME="${CONTAINER_NAME/\]/-}" +exec bash "$RUNTIME_ROOT/docker/docker_run_nav2.sh" "$CONTAINER_NAME" "$(dirname "$MODULE_PATH")" "$FOLDER_NAME" "${NAV2_DOCKER_IMAGE:-future-nav2-gazebo:humble}" "${ROS_DOMAIN_ID:-0}" sim_mode:=true platform:=turtlebot3 level:=2d "$@" diff --git a/src/autoware_auto_msgs/COLCON_IGNORE b/src/autoware_auto_msgs/COLCON_IGNORE new file mode 100755 index 0000000..e69de29 diff --git a/src/autoware_auto_msgs/DISCLAIMER.md b/src/autoware_auto_msgs/DISCLAIMER.md new file mode 100755 index 0000000..d0d6f97 --- /dev/null +++ b/src/autoware_auto_msgs/DISCLAIMER.md @@ -0,0 +1,50 @@ +DISCLAIMER + +The open-source software for self-driving vehicles, Autoware.AI, Autoware.IO, +Autoware.Auto. (collectively, referred to as “Autoware”) will be provided by +The Autoware Foundation under the Apache 2.0 License. This “DISCLAIMER” will be +applied to all users of Autoware (a “User” or “Users”) with the Apache 2.0 +License and Users shall hereby approve and acknowledge all the contents +specified in this disclaimer below and will be deemed to consent to this +disclaimer without any objection upon utilizing or downloading Autoware. + + +Disclaimer and Waiver of Warranties + +1. AUTOWARE FOUNDATION MAKES NO REPRESENTATION OR WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, WITH RESPECT TO PROVIDING AUTOWARE (the “Service”) +including but not limited to any representation or warranty (i) of fitness or +suitability for a particular purpose contemplated by the Users, (ii) of the +expected functions, commercial value, accuracy, or usefulness of the Service, +(iii) that the use by the Users of the Service complies with the laws and +regulations applicable to the Users or any internal rules established by +industrial organizations, (iv) that the Service will be free of interruption or +defects, (v) of the non-infringement of any third party's right and (vi) the +accuracy of the content of the Services and the software itself. + +2. The Autoware Foundation shall not be liable for any damage incurred by the +User that are attributable to the Autoware Foundation for any reasons +whatsoever. UNDER NO CIRCUMSTANCES SHALL THE AUTOWARE FOUNDATION BE LIABLE FOR +INCIDENTAL, INDIRECT, SPECIAL OR FUTURE DAMAGES OR LOSS OF PROFITS. + +3. A User shall be entirely responsible for the content posted by the User and +its use of any content of the Service or the Website. If the User is held +responsible in a civil action such as a claim for damages or even in a criminal +case, the Autoware Foundation and member companies, governments and academic & +non-profit organizations and their directors, officers, employees and agents +(collectively, the “Indemnified Parties”) shall be completely discharged from +any rights or assertions the User may have against the Indemnified Parties, or +from any legal action, litigation or similar procedures. + + +Indemnity + +A User shall indemnify and hold the Indemnified Parties harmless from any of +their damages, losses, liabilities, costs or expenses (including attorneys' +fees or criminal compensation), or any claims or demands made against the +Indemnified Parties by any third party, due to or arising out of, or in +connection with utilizing Autoware (including the representations and +warranties), the violation of applicable Product Liability Law of each country +(including criminal case) or violation of any applicable laws by the Users, or +the content posted by the User or its use of any content of the Service or the +Website. diff --git a/src/autoware_auto_msgs/LICENSE b/src/autoware_auto_msgs/LICENSE new file mode 100755 index 0000000..b0d6135 --- /dev/null +++ b/src/autoware_auto_msgs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 ApexAI + + 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. diff --git a/src/autoware_auto_msgs/README.md b/src/autoware_auto_msgs/README.md new file mode 100755 index 0000000..c1dbcc1 --- /dev/null +++ b/src/autoware_auto_msgs/README.md @@ -0,0 +1,77 @@ +This is a Tier4 forked version of [autoware_auto_msgs](https://gitlab.com/autowarefoundation/autoware.auto/autoware_auto_msgs) + +# autoware_auto_msgs + +Interfaces between core Autoware.Auto components. + +## Conventions + +### Comments + +Add a comment to describe the meaning of the field. + +### Default Value + +Prefer a meaningful default value. Otherwise, the field is uninitialized. + +### Optional parameters + +There is nothing like `std::optional` in IDL, unfortunately. To accomodate the common use case of a +fixed message where some variables are not always filled, add an additional boolean variable with a +prefix `has_` and a default value of `FALSE`. + +### Units + +If a quantity described by a field has an associated unit of measurement, the following rules apply to determine the field name: + +1. If the unit is as base or [derived SI unit](https://en.wikipedia.org/wiki/International_System_of_Units#Derived_units), do not add a suffix and assume the default from [REP-103](https://www.ros.org/reps/rep-0103.html). +1. If the unit is a multiple of a base or derived SI unit, apply a suffix according to the table below. +1. If the unit is composed of non-SI units, apply a suffix according to the table below. + +Only deviate from the SI units when absolutely necessary and with justification. + +| Quantity | Unit | Suffix | Notes | +|-----------------|-----------------------------|---------|---------------------------------------------------------| +| distance | meters | None | | +| | micrometers | `_um` | | +| | millimeters | `_mm` | | +| | kilometers | `_km` | | +| speed, velocity | meters / second | None | Use speed for scalar and velocity for vector quantities | +| | kilometers / hour | `_kmph` | | +| acceleration | meters / second2 | None | | +| radial velocity | radians / second | None | | +| time | second | None | | +| | microsecond | `_us` | | +| | nanosecond | `_ns` | | + +#### Examples + +The first alternative is recommended, the second discouraged: + +1. `float elapsed_time` vs `float_elapsed_time_s` +1. `float distance_travelled` vs `float distance_travelled_m` +1. `int32 time_step_ms` vs `int32 time_step` +1. `float speed_mps` vs `float speed` + +### Minimal Example + +```idl +struct Foo { + @verbatim (language="comment", text= + " A multiline" "\n" + " comment") + @default (value=0.0) + float bar_speed; + + @verbatim (language="comment", text= + " Another multiline" "\n" + " comment") + @default (value=FALSE) + boolean has_bar_speed; + + @verbatim (language="comment", text= + " Describe the time stamp") + @default (value=0) + int32 timestamp_ns; +}; +``` diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_control_msgs/CMakeLists.txt new file mode 100755 index 0000000..6cc556a --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/CMakeLists.txt @@ -0,0 +1,26 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_control_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/AckermannControlCommand.idl" + "msg/AckermannLateralCommand.idl" + "msg/HighLevelControlCommand.idl" + "msg/LongitudinalCommand.idl" + DEPENDENCIES + "builtin_interfaces" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannControlCommand.idl b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannControlCommand.idl new file mode 100755 index 0000000..916b130 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannControlCommand.idl @@ -0,0 +1,16 @@ +#include "autoware_auto_control_msgs/msg/AckermannLateralCommand.idl" +#include "autoware_auto_control_msgs/msg/LongitudinalCommand.idl" +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_control_msgs { + module msg { + @verbatim (language="comment", text= + " Lateral and longitudinal control message for Ackermann-style platforms") + struct AckermannControlCommand { + builtin_interfaces::msg::Time stamp; + + autoware_auto_control_msgs::msg::AckermannLateralCommand lateral; + autoware_auto_control_msgs::msg::LongitudinalCommand longitudinal; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannLateralCommand.idl b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannLateralCommand.idl new file mode 100755 index 0000000..e1df7fb --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/AckermannLateralCommand.idl @@ -0,0 +1,25 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_control_msgs { + module msg { + @verbatim (language="comment", text= + " Lateral control message for Ackermann-style platforms" "\n" + " Note regarding tires: If the platform has multiple steering tires, the commands" + " given here are for a virtual tire at the average lateral position of the steering tires.") + + struct AckermannLateralCommand { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Desired angle of the steering tire in radians left (positive)" + " or right (negative) of center (0.0)") + @default (value=0.0) + float steering_tire_angle; + + @verbatim (language="comment", text= + " Desired rate of change of the steering tire angle in radians per second") + @default (value=0.0) + float steering_tire_rotation_rate; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/HighLevelControlCommand.idl b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/HighLevelControlCommand.idl new file mode 100755 index 0000000..4fb6fbe --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/HighLevelControlCommand.idl @@ -0,0 +1,18 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_control_msgs { + module msg { + struct HighLevelControlCommand { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " should be negative when reversed") + @default (value=0.0) + float velocity_mps; + + @verbatim (language="comment", text= + " units of inverse meters") + float curvature; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/LongitudinalCommand.idl b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/LongitudinalCommand.idl new file mode 100755 index 0000000..4549bf0 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/msg/LongitudinalCommand.idl @@ -0,0 +1,30 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_control_msgs { + module msg { + @verbatim (language="comment", text= + " Longitudinal control message for all vehicle types") + + struct LongitudinalCommand { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Desired platform speed in meters per second." + " A positive value indicates movement in the positive X direction of the vehicle " + " while a negative value indicates movement in the negative X direction of the vehicle.") + @default (value=0.0) + float speed; + + @verbatim (language="comment", text= + " Desired platform acceleration in meters per second squared." + " A positive value indicates acceleration while a negative value indicates deceleration.") + @default (value=0.0) + float acceleration; + + @verbatim (language="comment", text= + " Desired platform jerk in meters per second cubed") + @default (value=0.0) + float jerk; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_control_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_control_msgs/package.xml new file mode 100755 index 0000000..cfddca3 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_control_msgs/package.xml @@ -0,0 +1,27 @@ + + + + autoware_auto_control_msgs + 1.0.0 + Interfaces between core Autoware.Auto control components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + builtin_interfaces + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + diff --git a/src/autoware_auto_msgs/autoware_auto_geometry_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/CMakeLists.txt new file mode 100755 index 0000000..9776f6b --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/CMakeLists.txt @@ -0,0 +1,26 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_geometry_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/Complex32.idl" + "msg/Quaternion32.idl" + "msg/RelativePositionWithCovarianceStamped.idl" + DEPENDENCIES + "geometry_msgs" + "std_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Complex32.idl b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Complex32.idl new file mode 100755 index 0000000..dbf8b94 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Complex32.idl @@ -0,0 +1,20 @@ +module autoware_auto_geometry_msgs { + module msg { + @verbatim (language="comment", text= + " Complex32.msg" "\n" + " Can be used to represent yaw angle for trajectories" "\n" + " To convert back to a yaw angle, see" "\n" + " https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles") + struct Complex32 { + @verbatim (language="comment", text= + " cos(yaw / 2)") + @default (value=1.0) + float real; + + @verbatim (language="comment", text= + " sin(yaw / 2)") + @default (value=0.0) + float imag; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Quaternion32.idl b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Quaternion32.idl new file mode 100755 index 0000000..1535d57 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/Quaternion32.idl @@ -0,0 +1,19 @@ +module autoware_auto_geometry_msgs { + module msg { + @verbatim (language="comment", text= + " Represents rotation, but with less precision than the message in common_interfaces") + struct Quaternion32 { + @default (value=0.0) + float x; + + @default (value=0.0) + float y; + + @default (value=0.0) + float z; + + @default (value=1.0) + float w; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/RelativePositionWithCovarianceStamped.idl b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/RelativePositionWithCovarianceStamped.idl new file mode 100755 index 0000000..9c79bcd --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/msg/RelativePositionWithCovarianceStamped.idl @@ -0,0 +1,16 @@ +#include "geometry_msgs/msg/Point.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_geometry_msgs { + module msg { + @verbatim (language="comment", text= + " This message is a generalized representation of a 3D pose without" + " orientation of the origin of one frame within a child frame.") + struct RelativePositionWithCovarianceStamped { + std_msgs::msg::Header header; + string child_frame_id; + geometry_msgs::msg::Point position; + double covariance[9]; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_geometry_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/package.xml new file mode 100755 index 0000000..3dcf3e2 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_geometry_msgs/package.xml @@ -0,0 +1,28 @@ + + + + autoware_auto_geometry_msgs + 1.0.0 + Geometry related message definitions in Autoware.Auto + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + geometry_msgs + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/CMakeLists.txt new file mode 100755 index 0000000..6c06060 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/CMakeLists.txt @@ -0,0 +1,26 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_mapping_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/HADMapBin.idl" + "msg/HADMapSegment.idl" + "msg/MapPrimitive.idl" + "srv/HADMapService.idl" + DEPENDENCIES + "std_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapBin.idl b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapBin.idl new file mode 100755 index 0000000..3559489 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapBin.idl @@ -0,0 +1,32 @@ +#include "std_msgs/msg/Header.idl" + +module autoware_auto_mapping_msgs { + module msg { + module HADMapBin_Constants { + const uint8 MAP_FORMAT_LANELET2 = 0; + }; + @verbatim(language = "comment", text = + "HADMap contents in binary blob format") + struct HADMapBin + { + std_msgs::msg::Header header; + @verbatim(language = "comment", text = + "HADMap format identifier, allows supporting multiple map formats") + uint8 map_format; + + @verbatim(language = "comment", text = + "Version of map format. Keep as empty string if unnecssary") + @default(value = "") + string format_version; + + @verbatim(language = "comment", text = + "Version of map. Keep as empty empty if unnecessary") + @default(value = "") + string map_version; + + @verbatim(language = "comment", text = + "Binary map data") + sequence < uint8 > data; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapSegment.idl b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapSegment.idl new file mode 100755 index 0000000..52ed820 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/HADMapSegment.idl @@ -0,0 +1,12 @@ +#include "autoware_auto_mapping_msgs/msg/MapPrimitive.idl" + +module autoware_auto_mapping_msgs { + module msg { + @verbatim (language="comment", text= + " A segment of an HADMap which contains one or more MapPrimitives.") + struct HADMapSegment { + sequence primitives; + int64 preferred_primitive_id; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/MapPrimitive.idl b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/MapPrimitive.idl new file mode 100755 index 0000000..6dea38b --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/msg/MapPrimitive.idl @@ -0,0 +1,17 @@ +#include "std_msgs/msg/Header.idl" + +module autoware_auto_mapping_msgs { + module msg { + @verbatim(language = "comment", text = + "Map primitive information") + struct MapPrimitive + { + int64 id; + + @verbatim(language = "comment", text = + "Type of primitive, such as lane, polygon, line.") + @default(value = "") + string primitive_type; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/package.xml new file mode 100755 index 0000000..a57f0ca --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/package.xml @@ -0,0 +1,27 @@ + + + + autoware_auto_mapping_msgs + 1.0.0 + Interfaces between core Autoware.Auto mapping components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_mapping_msgs/srv/HADMapService.idl b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/srv/HADMapService.idl new file mode 100755 index 0000000..012cdac --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_mapping_msgs/srv/HADMapService.idl @@ -0,0 +1,39 @@ +#include "autoware_auto_mapping_msgs/msg/HADMapBin.idl" + +module autoware_auto_mapping_msgs { + module srv { + // enum type not working yet on ROS2 implementation of idl + // enum HADPrimitive + // { + // FullMap, + // AllPrimitives, + // DriveableGeometry, + // RegulatoryElements, + // StaticObjects + // }; + + module HADMapService_Request_Constants { + const uint8 FULL_MAP = 0; + const uint8 ALL_PRIMITIVES = 1; + const uint8 DRIVEABLE_GEOMETRY = 2; + const uint8 REGULATORY_ELEMENTS = 3; + const uint8 STATIC_OBJECTS = 4; + }; + + struct HADMapService_Request + { + sequence < uint8 > requested_primitives; + @verbatim(language = "comment", text = + "Geometric upper bound of map data requested") + sequence < double, 3 > geom_upper_bound; + @verbatim(language = "comment", text = + "Geometric upper bound of map data requested") + sequence < double, 3 > geom_lower_bound; + }; + struct HADMapService_Response + { + autoware_auto_mapping_msgs::msg::HADMapBin map; + int32 answer; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/CHANGELOG.rst b/src/autoware_auto_msgs/autoware_auto_msgs/CHANGELOG.rst new file mode 100755 index 0000000..7e4ae3e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/CHANGELOG.rst @@ -0,0 +1,57 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package autoware_auto_msgs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +1.0.0 (2021-01-05) +------------------ +* Merge branch 'BoundingBoxArray-design' into 'master' + Add design doc for bounding-box message + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!12 `_ +* Working around https://github.com/ros-tooling/libstatistics_collector/issues/51. +* Fixing constants in AutonomyModeChange. +* Making AutonomyModeChange return empty. +* Merge branch '657-autonomy-service' into 'master' + Adding AutonomyModeChange service definition. + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!11 `_ +* Adding velocity_mps to VehicleControlCommand. +* Merge branch '474-add-modify-trajectory-service' into 'master' + Adding ModifyTrajectory service definition. + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!10 `_ +* Merge branch 'modify-plan-trajectory-action' into 'master' + modify PlanTrajectory Action to return trajectory in Result + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!9 `_ +* Merge branch 'fix/plan_trajectory_action' into 'master' + fix include file and namespace of constants + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!8 `_ +* Merge branch 'add-actions-dependency' into 'master' + Cleaning up package.xml and adding action_msgs dependency. + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!7 `_ +* Merge branch 'add-plan-trajectory-action' into 'master' + add PlanTrajectory action + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!6 `_ +* Contributors: Frederik Beaujean, Joshua Whitley, mitsudome-r + +0.1.0 (2020-08-07) +------------------ +* Merge branch 'add-hadmap-msgs' into 'master' + had map msgs - respect idl constant naming conventions + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!5 `_ +* Merge branch 'add-hadmap-msgs' into 'master' + Add hadmap msgs + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!4 `_ +* Add hadmap msgs +* Merge branch '3-convert-messages-from-rosmsg-to-idl' into 'master' + Resolve "Convert messages from ROSmsg to IDL" + Closes `#3 `_ + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!2 `_ +* Resolve "Convert messages from ROSmsg to IDL" +* Contributors: Esteve Fernandez, Joshua Whitley, simon-t4 + +0.0.2 (2020-03-02) +------------------ +* Merge branch '1-import-autoware_auto_msgs-from-autoware-auto' into 'master' + Resolve "Import autoware_auto_msgs from Autoware.Auto" + Closes `#1 `_ + See merge request `autowarefoundation/autoware.auto/autoware_auto_msgs!1 `_ +* Initial import +* Contributors: Esteve Fernandez, Geoffrey Biggs diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_msgs/CMakeLists.txt new file mode 100755 index 0000000..df1cc27 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/CMakeLists.txt @@ -0,0 +1,16 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_internal_msgs-design.md b/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_internal_msgs-design.md new file mode 100755 index 0000000..af82034 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_internal_msgs-design.md @@ -0,0 +1,67 @@ +autoware_auto_msgs internal message design +========================= + +[TOC] + +This document is intended to track the design and rationale of messages internal to individual +components/stacks. + +# Perception + +This supersection tracks messages relating to the perception components of the autonomous driving +stack. + +## Object Detection + +This section tracks internal messages needed for the implementation of object detection stacks +that result in the emission of the `BoundingBoxArray` type as a common object list representation. + +### Classical 3d object detection + +This section covers the internal messages needed by a classical 3d object detection stack, +consisting of ground filtering, downsampling, clustering, and finally hull formation. + +#### PointClusters + +``` +sensor_msgs/PointCloud2[] clusters +``` + +This message represents a set of point clusters as a result of object detection or clustering. +`PointCloud2` was used as a cluster can be conceived as a subset of a point cloud, and +`PointCloud2` is the standard representation for point clouds. + + +## Tracking + +This section tracks messages internal to specific implementation of tracking stacks. + +# Localization + +This supersection tracks messages relating to the implementation of localization/mapping +components in the autonomous driving stack. + +# Planning + +This supersection tracks messages relating to the implementation of planning components in the +autonomous driving stack. + +## Global Planning + +This section tracks internal messages needed for the implementation of specific global planning +stacks. + +## Behavior Planning + +This section tracks internal messages needed for the implementation of specific behavior planning +stacks. + +## Motion Planning + +This section tracks internal messages needed for the implementation of specific motion planning +stacks. + +## Control + +This section tracks internal messages needed for the implementation of specific controller +stacks. diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_msgs-design.md b/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_msgs-design.md new file mode 100755 index 0000000..a05b1a5 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/design/autoware_auto_msgs-design.md @@ -0,0 +1,513 @@ +autoware_auto_msgs +================== + +[TOC] + +This document contains the intended sources, recipients and rationale for each of the custom +message types. + +# Helper Types + +The following are helper types that are composed into messages that software components use. + +## Complex32 + +``` +float32 real +float32 imag +``` + +## BoundingBox + +``` +geometry_msgs/Point32 centroid +geometry_msgs/Point32 size +geometry_msgs/Quaternion orientation +geometry_msgs/Point32[4] corners +float32 value +uint32 label +``` +See the [design document](bounding-box-design.md) for further details. + +## BoundingBoxArray + +``` +std_msgs/Header header +BoundingBox[256] boxes +uint32 size +uint32 CAPACITY=256 +``` + + +## DiagnosticHeader + +``` +string name +builtin_interfaces/Time data_stamp +builtin_interfaces/Time computation_start +builtin_interfaces/Duration runtime +uint32 iterations +``` + +## TrajectoryPoint + +``` +builtin_interfaces/Duration time_from_start +float32 x +float32 y +Complex32 heading +float32 longitudinal_velocity_mps 0.0 +float32 lateral_velocity_mps 0.0 +float32 acceleration_mps2 +float32 heading_rate_rps +float32 front_wheel_angle_rad 0.0 +float32 rear_wheel_angle_rad 0.0 +``` + +> `acceleration_mps2` increases/decreases based on absolute vehicle motion and does not consider vehicle direction (forward/backward) + +And the heading field has the following form: + +A zero heading corresponds to the positive x direction in the given coordinate frame. + +**Default Values**: All trajectory point and trajectory fields should default to 0 + +**Default Values**: All complex numbers should default to the pair (1, 0), which corresponds to a +zero heading. + +**Extensions**: In the future, this message may include higher derivative information. + +**Rationale**: Trajectory points mirror, but are not the same as a standard JointTrajectory message. +This is because the standard message allows room for ambiguities whereas this message does not. + +**Rationale**: Higher derivative information (e.g. acceleration, heading rate) is available to +provide a more expressive language for controllers and trajectory planners. If the information +is not needed, a value of zero is provided, which is semantically consistent for controllers and +motion planners + +**Rationale**: Complex numbers are used to represent heading rather than an angle because it reduces +ambiguities between angles, and angle distances. In addition, it conveniently represents a +precomputed sine and cosine values, obviating the need for additional computations. + +For more details, see [Controller design](@ref controller-design) + +# Interface Messages + +## Control Diagnostic + +``` +DiagnosticHeader diag_header +bool new_trajectory +string trajectory_source +string pose_source +float32 lateral_error_m +float32 longitudinal_error_m +float32 velocity_error_mps +float32 acceleration_error_mps2 +float32 yaw_error_rad +float32 yaw_rate_error_rps +``` + +**Source**: Controller + +**Recipient(s)**: + +**Rationale**: Diagnostic information is helpful to detect if a fault occurred, or some incorrect +behavior leading up to a fault. It can also be used for infotainment applications. + +For more details, see [Controller design](@ref controller-design) + +## Trajectory + +``` +std_msgs/Header header +TrajectoryPoint[<=100] points +``` + +**Source**: Motion planner + +**Recipient(s)**: Controller + +**Rationale**: A bounded number of points is provided since a new trajectory should be provided +at a regular rate. Bounded data structures also imply more deterministic communication times +due to having a bounded size. + +For more details, see [Controller design](@ref controller-design) + +### RawControlCommand + +This message type is defined as follows: + +``` +builtin_interfaces/Time stamp +uint32 throttle +uint32 brake +int32 front_steer +int32 rear_steer +``` + +This type is intended to be used when direct control of the vehicle hardware is required. As such, +no assumptions about units are made. It is the responsibility of the system integrator to ensure +that the values used are appropriate for the vehicle platform. + +**Source**: Controller + +**Recipient(s)**: Vehicle Interface + +**Default Values**: The default value for all fields is 0 + +**Rationale**: A time stamp field is provided because a control command should be generated in +response to the input of a vehicle kinematic state. Retaining the time of the triggering data +should aid with diagnostics and traceability. + +**Rationale**: The rear wheel angle is also provided to enable support for rear drive vehicles, +such as forklifts. + +**Rationale**: A frame is not provided since it is implied that it is fixed to the vehicle frame. + +**Rationale**: Throttle and brake are separated as they are fundamentally controlled by two +different actuators + +**Rationale**: This is intended to be compatible with using the triggers of a gamepad as a first +pass for vehicle platform validation. + +**Rationale**: Integer values are used to be more compatible with discrete, or byte-level +representation that is more common with CAN interfaces. + +**Rationale**: Units are not provided since byte-level representations are generally platform- +specific. + +For more details see [vehicle interface design](). + +### HighLevelControlCommand + +This message type is defined as follows: + +``` +builtin_interfaces/Time stamp +# should be negative when reversed +float32 velocity_mps 0.0 +float32 curvature +``` + +This type is intended to be used as an interface when only simple control is required, and thus +abstracts away more direct control of the vehicle. + +**Source**: Controller + +**Recipient(s)**: Vehicle Interface + +**Default Values**: The default value for all fields is 0 + +**Rationale**: A time stamp field is provided because a control command should be generated in +response to the input of a vehicle kinematic state. Retaining the time of the triggering data +should aid with diagnostics and traceability. + +**Rationale**: A frame is not provided since it is implied that it is fixed to the vehicle frame. + +**Rationale**: Curvature is used as a control target as it does not require any vehicle-specific +information. This is inspired by the AutonomousStuff Low Level Controller + +**Rationale**: Velocity is used as a longitudinal control target to allow the vehicle to minimally +follow a geometric reference path. + +For more details see [vehicle interface design](). + + +## Vehicle Control Command +``` +builtin_interfaces/Time stamp +float32 long_accel_mps2 +float32 front_wheel_angle_rad +float32 rear_wheel_angle_rad +``` + +This message type is intended to provide a proxy for a foot on the accelerator and brake pedal, +and a pair of hands on the steering wheel, while also providing a convenient representation +for controller developers. + +These wheel angles are counter-clockwise positive, where 0 corresponds to a neutral, or +forward-facing orientation. + +**Source**: Controller + +**Recipient(s)**: Vehicle Interface + +**Default Values**: The default value for all fields is 0 + +**Rationale**: A time stamp field is provided because a control command should be generated in +response to the input of a vehicle kinematic state. Retaining the time of the triggering data +should aid with diagnostics and traceability. + +**Rationale**: A single acceleration field is provided because controllers typically plan a +longitudinal acceleration and turning angle for the rigid body. Braking is baked into this single +command for simplicity of controller development, and because it is generally not expected for both +the brake to be depressed and the accelerator at the same time. + +**Rationale**: Wheel steering angles are provided since it allows the controller to only require a +simplified view of the vehicle platform, such as knowing the wheelbase length. Depending on the +implementation of a drive-by-wire interface, producing a given wheel angle may require knowledge +of the mapping between steering wheel angle to wheel angle. + +**Rationale**: The rear wheel angle is also provided to enable support for rear drive vehicles, +such as forklifts. + +**Rational**: A frame is not provided since it is implied that it is fixed to the vehicle frame. + +For more details, see [Controller design](@ref controller-design) + +## Vehicle Kinematic State +**Source**: Vehicle interface + +**Recipient(s)**: Behavior Planner +``` +std_msgs/Header header +TrajectoryPoint state +geometry_msgs/Transform delta +``` + +The `TrajectoryPoint::time_from_start` field should also be filled with the time difference between +the current state and the previous state message. + +The position fields of the `TrajectoryPoint` member should contain the position of the ego vehicle +with respect to a fixed frame, if available. If the frame is a dynamic frame (e.g. `base_link`), +then this position field should be taken as unavailable or invalid. The further kinematics of this +member should always be available, and populated according to the appropriate coordinate frame, +making the additional assumption that the coordinate frame is static. + +The delta member is the transform of the message should represent the positional update of the +ego vehicle's coordinate frame relative to it's last position and orientation. + +**Source**: Vehicle State Estimator + +**Recipient(s)**: Planning stack (Route planner, Behavior Planner, Motion Planner, Controller), +Tracker + +**Default Values**: The trajectory point should be appropriately default initialized + +**Default Values**: The delta transform field should have zero translation and the unit quaternion +by default. + +**Extensions**: State and transform uncertainty may be added as variances or covariance matrices. +This may be necessary for probabilistic algorithms (e.g. robust MPC) + +**Rationale**: An underlying trajectory point is used because kinematic information may be needed +by controllers. Further, representing the vehicle state in a manner that mirrors the trajectory +fits with the semantic purpose of a controller: matching the current state to a state sequence + +**Rationale**: A transform relative to the previous position and orientation of the ego vehicle is +provided because while absolute position may not always be available with accuracy, this relative +transform should be available with some degree of accuracy (e.g. via IMU information, odometry +information, etc.). The availability of this information allows for planning and tracking within a +local coordinate frame. For example, in a level 3 highway driving use case, a trajectory may be +rooted at the ego vehicle's position at some time stamp. The accumulation of these relative +transforms would allow for a controller to properly follow the trajectory. + +**Rationale**: The kinematics are populated with a fixed frame assumption to simplify the updates +and usage of this field. + +For more details, see [Controller design](@ref controller-design) + +## Vehicle Odometry + +``` +builtin_interfaces/Time stamp +float32 velocity_mps +float32 front_wheel_angle_rad +float32 rear_wheel_angle_rad +``` + +This message reports the kinematic state of the vehicle as the vehicle itself reports. The intended +use case for this message could be in motion planning for initial conditions, or dead reckoning. + +**Source**: Vehicle interface + +**Recipient(s)**: Vehicle State Estimator + +**Default Values**: The default value for this message should be 0 in all fields. + +**Rationale**: This message is separate from the vehicle state report since they are typically for +distinct use cases (e.g. behavior planning vs dead reckoning) + +**Rationale**: A vehicle is expected to have encoders which provide velocity, and steering angle. +Acceleration and other fields may not be available on all vehicle platforms. + +**Rationale**: A stamp is expected here because this is timely information. In this sense, the +vehicle interface is acting as a sensor driver. + +**Rationale**: A frame id is not provided because these are assumed to be fixed to the vehicle +frame, and heading information is not available. + +## Vehicle State Command + +``` +builtin_interfaces/Time stamp +uint8 blinker +uint8 headlight +uint8 wiper +uint8 gear +uint8 mode +bool hand_brake +bool horn +bool autonomous + +### Definitions +# Blinker +uint8 BLINKER_NO_COMMAND = 0; +uint8 BLINKER_OFF = 1; +uint8 BLINKER_LEFT = 2; +uint8 BLINKER_RIGHT = 3; +uint8 BLINKER_HAZARD = 4; +# Headlight +uint8 HEADLIGHT_NO_COMMAND = 0; +uint8 HEADLIGHT_OFF = 1; +uint8 HEADLIGHT_ON = 2; +uint8 HEADLIGHT_HIGH = 3; +# Wiper +uint8 WIPER_NO_COMMAND = 0; +uint8 WIPER_OFF = 1; +uint8 WIPER_LOW = 2; +uint8 WIPER_HIGH = 3; +uint8 WIPER_CLEAN = 4; +# Gear +uint8 GEAR_NO_COMMAND = 0 +uint8 GEAR_DRIVE = 1 +uint8 GEAR_REVERSE = 2 +uint8 GEAR_PARK = 3 +uint8 GEAR_LOW = 4 +uint8 GEAR_NEUTRAL = 5 +# Mode +uint8 MODE_NO_COMMAND = 0; +uint8 MODE_AUTONOMOUS = 1; +uint8 MODE_MANUAL = 2; +``` + +This message is intended to control the remainder of the vehicle state, e.g. those not required for +minimal collision-free driving. + +**Source**: Behavior Planner + +**Recipient(s)**: Vehicle interface + +**Default Values**: The default value for all fields should be zero. + +**Rationale**: Hazard lights superseded a left/right signal, and as such are an exclusive state + +**Rationale**: Cleaning might be necessary to ensure adequate operation of sensors mounted behind +the wind shield + +**Rationale**: A horn might be required to signal to other drivers + +**Rationale**: Autonomous is a flag because this is a command message: true requests a transition +to autonomous, false requests a disengagement to manual. + +**Rationale**: While additional states are possible for other fields (e.g. headlights, wipers, +gears, etc.), this message only prescribes the minimal set of states that most or all vehicles +can satisfy. + +**Rationale**: Since commands here represent a state transition, a command of NONE denotion "no +state transition" is also valid + + +## Vehicle State Report + +``` +builtin_interfaces/Time stamp +uint8 fuel # 0 to 100 +uint8 blinker +uint8 headlight +uint8 wiper +uint8 gear +uint8 mode +bool hand_brake +bool horn + +### Definitions +# Blinker +uint8 BLINKER_OFF = 1 +uint8 BLINKER_LEFT = 2 +uint8 BLINKER_RIGHT = 3 +uint8 BLINKER_HAZARD = 4 +# Headlight +uint8 HEADLIGHT_OFF = 1 +uint8 HEADLIGHT_ON = 2 +uint8 HEADLIGHT_HIGH = 3 +# Wiper +uint8 WIPER_OFF = 1 +uint8 WIPER_LOW = 2 +uint8 WIPER_HIGH = 3 +uint8 WIPER_CLEAN = 4 +# Gear +uint8 GEAR_DRIVE = 1 +uint8 GEAR_REVERSE = 2 +uint8 GEAR_PARK = 3 +uint8 GEAR_LOW = 4 +uint8 GEAR_NEUTRAL = 5 +# Autonomous +uint8 MODE_AUTONOMOUS = 1 +uint8 MODE_MANUAL = 2 +uint8 MODE_DISENGAGED = 3 +uint8 MODE_NOT_READY = 4 +``` + +**Source**: Vehicle interface + +**Recipient(s)**: Behavior Planner + +**Default Value**: N/A. All fields should be populatable by the vehicle interface. + +**Rationale**: A discrete fuel range is provided as finer granularity is likely unnecessary. + +**Rationale**: A simple state machine is provided to ensure that disambiguate between intentionally +manual, and two modes of unintentionally being in manual mode: due to preconditions not being met, +or due to some failure of the autonomous driving stack. + +**Rationale**: Constants are kept the same as VehicleStateCommand to prevent subtle bugs from being +introduced. The constant 0 is reserved for NO_COMMAND in VehicleStateCommand. + +# References + +- AutowareAuto#62 + +## Related Message Types + +### ROS + +- [JointTrajectory.msg](https://github.com/ros2/common_interfaces/blob/master/trajectory_msgs/msg/JointTrajectoryPoint.msg) +- [PointStamped](http://docs.ros.org/lunar/api/geometry_msgs/html/msg/PointStamped.html) +- [PoseStamped](http://docs.ros.org/lunar/api/geometry_msgs/html/msg/PoseStamped.html) +- [TransformStamped](http://docs.ros.org/melodic/api/geometry_msgs/html/msg/TransformStamped.html) +- [NavSatFix](http://docs.ros.org/melodic/api/sensor_msgs/html/msg/NavSatFix.html) + +### Autoware.AI + +- [AccelCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/AccelCmd.msg) +- [BrakeCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/BrakeCmd.msg) +- [ControlCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/ControlCommand.msg) +- [IndicatorCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/IndicatorCmd.msg) +- [LampCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/LampCmd.msg) +- [RemoteCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/RemoteCmd.msg) +- [SteerCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/SteerCmd.msg) +- [VehicleCmd](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/VehicleCmd.msg) +- [VehicleStatus](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/VehicleStatus.msg) +- [Waypoint](https://github.com/CPFL/Autoware/blob/master/ros/src/msgs/autoware_msgs/msg/Waypoint.msg) + +### Apollo + +Controller/Interface Messages +- [VehicleSignal](https://github.com/ApolloAuto/apollo/blob/fb12723bd6dcba88ecccb6123ea850da1e050171/modules/common/proto/vehicle_signal.proto) +- [Lexus](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/canbus/proto/lexus.proto) +- [DriveState](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/common/proto/drive_state.proto) +- [VehicleState](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/common/vehicle_state/proto/vehicle_state.proto) +- [ControlCmd](https://github.com/ApolloAuto/apollo/blob/3d6f86e21a3c3ac43cf08423d4c3f92bc63ecac9/modules/control/proto/control_cmd.proto) + +Configuration Messages +- [LonControllerConf](https://github.com/ApolloAuto/apollo/blob/3d6f86e21a3c3ac43cf08423d4c3f92bc63ecac9/modules/control/proto/lon_controller_conf.proto) +- [LatControllerConf](https://github.com/ApolloAuto/apollo/blob/e9156ced04a8f0e372c781d803fd43428ab6c497/modules/control/proto/lat_controller_conf.proto) +- [ControlConf](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/control/proto/control_conf.proto) +- [MPCControllerConf](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/control/proto/mpc_controller_conf.proto) + +Algorithm Status Messages +- [PlanningStatus](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/planning/proto/planning_status.proto) +- [LocalizationStatus](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/localization/proto/localization_status.proto) +- [PlanningStats](https://github.com/ApolloAuto/apollo/blob/51651b9105e55c14e65cc2bd349b479e55fffa36/modules/planning/proto/planning_stats.proto) diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/design/bounding-box-design.md b/src/autoware_auto_msgs/autoware_auto_msgs/design/bounding-box-design.md new file mode 100755 index 0000000..696fa1d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/design/bounding-box-design.md @@ -0,0 +1,224 @@ +BoundingBox message design {#bounding-box-design} +========================== + +# Motivation + +In order to ensure a modular system, it's assumed that object detectors are architecturally +delineated. In other words, software components which can produce instantaneous observations of +objects are delineated from other components in the autonomous driving stack. + +This assumption or decomposition allows us to interchangeably use various forms of object detectors +with various forms of multi-object tracking (by assignment) algorithms. If a tighter coupling +between object detection and tracking is required, specialized combined stacks can be developed. + +In order to facilitate the isolation of object detectors as a module, common messages types are +defined as an interface or output of the object detectors to other components. + + +# Use cases + +The instantaneous detection of objects primarily has three use cases: + +1. Collision detection (as a part of planning) +2. Tracking (which may eventually be an input to planning) +3. Region of Interest identification (as a preprocessing step to localization/mapping) + +In addition, there is the implied use case that this message representation is used on a safety- +critical system. + + +# Requirements + +## Safety-critical systems + +Safety-critical systems require real-time and static memory applications. As such, this implies +that the representation of the message must be upper bounded in size. + +For the purpose of performance, an optional requirement is added to message definitions such that +the maximum size is no more than `64kB`, which is also the maximum size of a single UDP packet. This +requirement ensures that latency is kept to a minimum if interprocess communication is necessary at +the interface of the object detection algorithms. + + +## Collision detection + +In order to detect collisions, the representation must have: + +1. A position at least in 2-space (with the assumption that the object is on the same plane as the +ego) +2. A bounding volume representation which fully contains the detected object +3. A way to ensure the object representation is in a consistent coordinate frame with respect to the +ego +4. Optionally uncertainty representation of the above parameters + + +## Tracking + +The purpose of tracking is to maintain a consistent identity of a detected object over time. +In addition, tracking may also produce state estimates over time, such as kinematic estimates, +shape estimates, or label estimates. + +To satisfy the fundamental requirement of tracking, the message representation must provide features +that can be used for assignment, or association of current observations with previous observations. +Features that can satisfy this requirement include: + +1. Position information +2. Shape information (e.g. convex hull, bounding ellipse/box, shape features, etc.) +3. Object information (e.g. color/intensity distribution, classification label, etc.) +4. Other sensor information (e.g. velocity, heading, turn rate (via FMCW sensors)) +5. Optionally uncertainty information for the above parameters + +Classically, position information is the most important association feature, assuming a continuous +world and a relatively high sampling frequency. + +The other features can be used to motivate various state estimates in the tracking stack. + +## Region of interest detection + +An object detector can also be used to identify regions of interest for various other stacks, such +as feature-based localization/mapping, or scene understanding (sign/scenario detection). + +The localization/mapping use case is largely similar to the tracking use case insofar as it requires +assignment or association of features. In contrast, scene understanding requires an identification +of the relevant objects and their position in a space that is compatible with the ego frame. + +As such, the features needed to satisfy this use case are similar to that of the tracking use case: + +1. Position information +2. Shape/object information +3. Optionally uncertainty information + + +# Message definition + +Based on the requirements laid out, some assumptions and simplifications can be made, and a message +type can be defined. + +If any of the assumptions and simplifications must be broken for the proper operation of the +algorithm, then the choice of algorithm should be reconsidered, or a parallel construct which +encapsulates multiple software components should be made. + +In the case when a stack cannot populate certain fields of the interface, the field should be in +an identifiably non-normal state, such as zero or NaN. + + +## Safety critical requirements + +To satisfy the minimal latency requirement, the representation must be bounded in size to `64kB`. + +If it's additionally assumed that `1kB` is used for secondary representation and there are +piggy-backed submessages in the communication sublayer, the maximum representation size is +`63kB`. + +Next, it's assumed that some maximum number of objects that are detected instantaneously. Based on +current observations of Apex.AI urban driving use cases, typically 50-70 objects are observed per +scene. Applying a healthy safety factor gives a maximum object bound of 256 objects per frame. + +These two assumptions combined lead us to have a maximum representation size of `250B`. + + +## Position requirements + +Minimally, a 3D position is used to satisfy the position requirement inherent in all use cases. A 3D +position is used to be more general, and apply to other stacks, such as a vision/camera-based stack. + +To satisfy the compatibility of representational spaces, it's assumed that all observations are made +in a common frame. This frame can then be represented by a string in the aggregate object type. +It is assumed that it is the responsibility of the consuming algorithm to have and transform the +position space into the correct coordinate frame given this information. + + +## Shape requirements + +Next, the shape of the object is represented as a bounding box in 3 interdependent ways: + +- A quaternion for orientation +- A 3D size parameter +- Four 3D positions for the corners of the bounding box + +A bounding box representation was used because many objects in the autonomous driving use case +are approximately box-shaped. In addition, many efficient algorithms exist in both the 2D and 3D +case to compute bounding boxes. Finally, bounding boxes are convenient, close-formed representations +of objects, as opposed to a convex hull which can be potentially unbounded in representation size. + +A quaternion is used to represent orientation. An oriented bounding box is used as opposed to +axis-aligned bounding boxes because it can better represent and fit to objects. A quaternion +is used to represent orientation in the SO(3) space because it is continuously varying without +singularities. In addition, it can be used to efficiently calculate sine and cosine values. + +Finally, the size and corners of the bounding box is represented. While the two +together represent redundant information, both parameters are byproducts of the bounding box +computation process, and communicating both forms of information downstream can reduce the +computational burden and repeated work of algorithms downstream. + +For example, size can be used as a coarse collision-checking step, whereas the corners are used +for fine-grained collision detection. Similarly, the size of the bounding may be treated as direct +extent observations in the tracking case, whereas the corners may be treated as proxy observations +of the centroid. + + +## Object/Other requirements + +Of all the object features proposed, only a classification label is bounded in representation size +(assuming a finite set of classes). While the other features could be bounded, they would be +severely limited in their representational capabilities due to the size limitations. + +As such, only a classification label is provided with the current form: + +`vehicle_label` is an 8-bit integer depicting the classification label of the bounding box. It +can take any of the following default values: + +``` +NO_LABEL=0 +CAR=1 +PEDESTRIAN=2 +CYCLIST=3 +MOTORCYCLE=4 +``` + +The `signal_label` field contains the back signal state of the car and can take any of the following + default values: + +``` +NO_SIGNAL=0 +LEFT_SIGNAL=1 +RIGHT_SIGNAL=2 +BRAKE=3 +``` + +Next, additional kinematic fields can potentially be populated at minimal size cost. These include +velocity, heading, and heading rate, assuming a FMCW/doppler-effect sensor is available. The +inclusion of such fields can greatly improve the performance of tracking, or in some cases remove +the necessity of tracking (i.e. predictive collision detection). + + +## Uncertainty requirements + +While uncertainty representation is not a strict requirement, the usage of uncertainty can greatly +improve the performance of downstream algorithms, both from the perspective of accuracy, and safety. + +Representing the full probabilistic state of the object is difficult due to size constraints, +as representing an 8-state covariance matrix would overrun the capacity, and +similarly representing the full classification distribution is potentially unbounded in size. + +As a compromise, several modeling simplifications and assumptions can be made for the bonus +representation of uncertainty. + +First, it can be assumed that the uncertainty of state variables are uncorrelated, implying all +off-diagonal elements of the full covariance matrix are zero, and thus need not be represented. +Second, the coarse modeling assumption of a uniformly distributed class assignment residual can +be used. As a result, class uncertainty can be represented with a single value. + + +# Future extensions + +The currently proposed representation for bounding boxes takes up approximately `150B` of the total +size budget of `230B`. This leaves room for up to 18 floating point values. These could be used to +cover the other optional requirements as a vector of floating points, with an optional ID denoting +the intended interpretation. + + +# Related issues + +- #3540: Update bounding box, add use cases +- #4069: Revise new articles for the 0.12.0 release diff --git a/src/autoware_auto_msgs/autoware_auto_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_msgs/package.xml new file mode 100755 index 0000000..a7dc9c3 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_msgs/package.xml @@ -0,0 +1,27 @@ + + + + autoware_auto_msgs + 1.0.0 + Interfaces between core Autoware.Auto components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + autoware_auto_control_msgs + autoware_auto_geometry_msgs + autoware_auto_mapping_msgs + autoware_auto_perception_msgs + autoware_auto_planning_msgs + autoware_auto_system_msgs + autoware_auto_vehicle_msgs + + ament_lint_auto + ament_lint_common + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_perception_msgs/CMakeLists.txt new file mode 100755 index 0000000..2582b6e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/CMakeLists.txt @@ -0,0 +1,52 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_perception_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/BoundingBox.idl" + "msg/BoundingBoxArray.idl" + "msg/ClassifiedRoi.idl" + "msg/ClassifiedRoiArray.idl" + "msg/DetectedObject.idl" + "msg/DetectedObjectKinematics.idl" + "msg/DetectedObjects.idl" + "msg/LookingTrafficSignal.idl" + "msg/ObjectClassification.idl" + "msg/PointClusters.idl" + "msg/PointXYZIF.idl" + "msg/PredictedObject.idl" + "msg/PredictedObjectKinematics.idl" + "msg/PredictedObjects.idl" + "msg/PredictedPath.idl" + "msg/Shape.idl" + "msg/TrackedObject.idl" + "msg/TrackedObjectKinematics.idl" + "msg/TrackedObjects.idl" + "msg/TrafficLight.idl" + "msg/TrafficLightRoi.idl" + "msg/TrafficLightRoiArray.idl" + "msg/TrafficSignal.idl" + "msg/TrafficSignalArray.idl" + "msg/TrafficSignalStamped.idl" + "msg/TrafficSignalWithJudge.idl" + DEPENDENCIES + "autoware_auto_geometry_msgs" + "geometry_msgs" + "sensor_msgs" + "std_msgs" + "unique_identifier_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBox.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBox.idl new file mode 100755 index 0000000..0dfd11c --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBox.idl @@ -0,0 +1,71 @@ +#include "autoware_auto_geometry_msgs/msg/Quaternion32.idl" +#include "geometry_msgs/msg/Point32.idl" + +module autoware_auto_perception_msgs { + module msg { + typedef geometry_msgs::msg::Point32 geometry_msgs__msg__Point32; + typedef geometry_msgs__msg__Point32 geometry_msgs__msg__Point32__4[4]; + typedef float float__8[8]; + module BoundingBox_Constants { + const uint8 NO_LABEL = 0; + const uint8 CAR = 1; + const uint8 PEDESTRIAN = 2; + const uint8 CYCLIST = 3; + const uint8 MOTORCYCLE = 4; + const uint8 NO_SIGNAL = 0; + const uint8 LEFT_SIGNAL = 1; + const uint8 RIGHT_SIGNAL = 2; + const uint8 BRAKE = 3; + const uint32 POSE_X = 0; + const uint32 POSE_Y = 1; + const uint32 VELOCITY = 2; + const uint32 HEADING = 3; + const uint32 TURN_RATE = 4; + const uint32 SIZE_X = 5; + const uint32 SIZE_Y = 6; + const uint32 ACCELERATION = 7; + }; + @verbatim (language="comment", text= + " Oriented bounding box representation") + struct BoundingBox { + geometry_msgs::msg::Point32 centroid; + + geometry_msgs::msg::Point32 size; + + autoware_auto_geometry_msgs::msg::Quaternion32 orientation; + + @default (value=0.0) + float velocity; + + @default (value=0.0) + float heading; + + @default (value=0.0) + float heading_rate; + + geometry_msgs__msg__Point32__4 corners; + + float__8 variance; + + @verbatim (language="comment", text= + " can hold arbitrary value, e.g. likelihood, area, perimeter") + float value; + + @verbatim (language="comment", text= + " can hold one of the vehicle constants defined below" "\n" + " NO_LABEL as default value") + @default (value=0) + uint8 vehicle_label; + + @verbatim (language="comment", text= + " can hold one of the signal constants defined below" "\n" + " NO_SIGNAL as default value") + @default (value=0) + uint8 signal_label; + + @verbatim (language="comment", text= + " Likelihood of vehicle label") + float class_likelihood; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBoxArray.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBoxArray.idl new file mode 100755 index 0000000..cedcaf3 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/BoundingBoxArray.idl @@ -0,0 +1,17 @@ +#include "autoware_auto_perception_msgs/msg/BoundingBox.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + module BoundingBoxArray_Constants { + const uint32 CAPACITY = 256; + }; + @verbatim (language="comment", text= + " Message for a full set of bounding boxes") + struct BoundingBoxArray { + std_msgs::msg::Header header; + + sequence boxes; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoi.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoi.idl new file mode 100755 index 0000000..88ff9d2 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoi.idl @@ -0,0 +1,15 @@ +#include "geometry_msgs/msg/Polygon.idl" +#include "autoware_auto_perception_msgs/msg/ObjectClassification.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text="A region of interest in an image with class information.") + struct ClassifiedRoi { + @verbatim (language="comment", text="A vector of possible classifications of this object.") + sequence classifications; + + @verbatim (language="comment", text="A 2D polygon describing the outline of an object in image coordinates.") + geometry_msgs::msg::Polygon polygon; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoiArray.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoiArray.idl new file mode 100755 index 0000000..1b58dd7 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ClassifiedRoiArray.idl @@ -0,0 +1,14 @@ +#include "autoware_auto_perception_msgs/msg/ClassifiedRoi.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " Message for a full set of classified ROIs") + struct ClassifiedRoiArray { + std_msgs::msg::Header header; + + sequence rois; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObject.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObject.idl new file mode 100755 index 0000000..151e2c6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObject.idl @@ -0,0 +1,16 @@ +#include "autoware_auto_perception_msgs/msg/DetectedObjectKinematics.idl" +#include "autoware_auto_perception_msgs/msg/ObjectClassification.idl" +#include "autoware_auto_perception_msgs/msg/Shape.idl" + +module autoware_auto_perception_msgs { + module msg { + struct DetectedObject { + @range (min=0.0, max=1.0) + float existence_probability; + + sequence classification; + autoware_auto_perception_msgs::msg::DetectedObjectKinematics kinematics; + autoware_auto_perception_msgs::msg::Shape shape; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjectKinematics.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjectKinematics.idl new file mode 100755 index 0000000..1c0961a --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjectKinematics.idl @@ -0,0 +1,42 @@ +#include "geometry_msgs/msg/Point.idl" +#include "geometry_msgs/msg/PoseWithCovariance.idl" +#include "geometry_msgs/msg/Quaternion.idl" +#include "geometry_msgs/msg/TwistWithCovariance.idl" + +module autoware_auto_perception_msgs { + module msg { + module DetectedObjectKinematics_Constants { + /** + * Only position is available, orientation is empty. Note that the shape can be an oriented + * bounding box but the direction the object is facing is unknown, in which case + * orientation should be empty. + */ + const uint8 UNAVAILABLE = 0; + /** + * The orientation is determined only up to a sign flip. For instance, assume that cars are + * longer than they are wide, and the perception pipeline can accurately estimate the + * dimensions of a car. It should set the orientation to coincide with the major axis, with + * the sign chosen arbitrarily, and use this tag to signify that the orientation could + * point to the front or the back. + */ + const uint8 SIGN_UNKNOWN = 1; + /** + * The full orientation is available. Use e.g. for machine-learning models that can + * differentiate between the front and back of a vehicle. + */ + const uint8 AVAILABLE = 2; + }; + + struct DetectedObjectKinematics { + geometry_msgs::msg::PoseWithCovariance pose_with_covariance; + + boolean has_position_covariance; + uint8 orientation_availability; + + geometry_msgs::msg::TwistWithCovariance twist_with_covariance; + + boolean has_twist; + boolean has_twist_covariance; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjects.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjects.idl new file mode 100755 index 0000000..c257bb4 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/DetectedObjects.idl @@ -0,0 +1,13 @@ +#include "autoware_auto_perception_msgs/msg/DetectedObject.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " This is the output of object detection and the input to tracking.") + struct DetectedObjects { + std_msgs::msg::Header header; + sequence objects; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/LookingTrafficSignal.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/LookingTrafficSignal.idl new file mode 100755 index 0000000..ed82595 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/LookingTrafficSignal.idl @@ -0,0 +1,14 @@ +#include "autoware_auto_perception_msgs/msg/TrafficSignalWithJudge.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + struct LookingTrafficSignal { + std_msgs::msg::Header header; + boolean is_module_running; + autoware_auto_perception_msgs::msg::TrafficSignalWithJudge perception; + autoware_auto_perception_msgs::msg::TrafficSignalWithJudge external; + autoware_auto_perception_msgs::msg::TrafficSignalWithJudge result; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ObjectClassification.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ObjectClassification.idl new file mode 100755 index 0000000..905c13e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/ObjectClassification.idl @@ -0,0 +1,24 @@ +module autoware_auto_perception_msgs { + module msg { + module ObjectClassification_Constants { + const uint8 UNKNOWN = 0; + const uint8 CAR = 1; + const uint8 TRUCK = 2; + const uint8 BUS = 3; + const uint8 TRAILER = 4; + const uint8 MOTORCYCLE = 5; + const uint8 BICYCLE = 6; + const uint8 PEDESTRIAN = 7; + }; + + struct ObjectClassification { + @verbatim (language="comment", text= + " Valid values for the label field are provided in" + " ObjectClassification_Constants.") + uint8 label; + + @range (min=0.0, max=1.0) + float probability; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointClusters.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointClusters.idl new file mode 100755 index 0000000..aad5cce --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointClusters.idl @@ -0,0 +1,18 @@ +#include "autoware_auto_perception_msgs/msg/PointXYZIF.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " Represent the clusters" "\n" + " The cluster 0 is from point 0 to point cluster_boundary[0] - 1." "\n" + " Cluster i would be from point cluster_boundary[i - 1] to cluster_boundary[i] - 1, and so on") + struct PointClusters { + std_msgs::msg::Header header; + + sequence points; + + sequence cluster_boundary; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointXYZIF.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointXYZIF.idl new file mode 100755 index 0000000..14429ec --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PointXYZIF.idl @@ -0,0 +1,20 @@ +module autoware_auto_perception_msgs { + module msg { + module PointXYZIF_Constants { + const uint16 END_OF_SCAN_ID = 65535; + }; + @verbatim (language="comment", text= + " This message is meant to mirror autoware::common::types::PointXYZIF") + struct PointXYZIF { + float x; + + float y; + + float z; + + float intensity; + + uint16 id; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObject.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObject.idl new file mode 100755 index 0000000..ed61108 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObject.idl @@ -0,0 +1,20 @@ +#include "autoware_auto_perception_msgs/msg/ObjectClassification.idl" +#include "autoware_auto_perception_msgs/msg/Shape.idl" +#include "autoware_auto_perception_msgs/msg/PredictedObjectKinematics.idl" +#include "unique_identifier_msgs/msg/UUID.idl" + +module autoware_auto_perception_msgs { + module msg { + struct PredictedObject { + unique_identifier_msgs::msg::UUID object_id; + + @range (min=0.0, max=1.0) + float existence_probability; + + sequence classification; + autoware_auto_perception_msgs::msg::PredictedObjectKinematics kinematics; + + autoware_auto_perception_msgs::msg::Shape shape; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjectKinematics.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjectKinematics.idl new file mode 100755 index 0000000..1cfed5e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjectKinematics.idl @@ -0,0 +1,18 @@ +#include "autoware_auto_perception_msgs/msg/PredictedPath.idl" +#include "geometry_msgs/msg/AccelWithCovariance.idl" +#include "geometry_msgs/msg/PoseWithCovariance.idl" +#include "geometry_msgs/msg/TwistWithCovariance.idl" + +module autoware_auto_perception_msgs { + module msg { + struct PredictedObjectKinematics { + geometry_msgs::msg::PoseWithCovariance initial_pose_with_covariance; + + geometry_msgs::msg::TwistWithCovariance initial_twist_with_covariance; + + geometry_msgs::msg::AccelWithCovariance initial_acceleration_with_covariance; + + sequence predicted_paths; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjects.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjects.idl new file mode 100755 index 0000000..f3d2ad6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedObjects.idl @@ -0,0 +1,13 @@ +#include "autoware_auto_perception_msgs/msg/PredictedObject.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " This is the output of object prediction.") + struct PredictedObjects { + std_msgs::msg::Header header; + sequence objects; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedPath.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedPath.idl new file mode 100755 index 0000000..628cf6f --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/PredictedPath.idl @@ -0,0 +1,15 @@ +#include "builtin_interfaces/msg/Duration.idl" +#include "geometry_msgs/msg/Pose.idl" + +module autoware_auto_perception_msgs { + module msg { + struct PredictedPath { + sequence path; + + @verbatim (language="comment", text= + " The time_step field defines the interval between consecutive pose predictions in the path array.") + builtin_interfaces::msg::Duration time_step; + float confidence; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/Shape.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/Shape.idl new file mode 100755 index 0000000..94e8869 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/Shape.idl @@ -0,0 +1,27 @@ +#include "geometry_msgs/msg/Polygon.idl" + +module autoware_auto_perception_msgs { + module msg { + module Shape_Constants { + const uint8 BOUNDING_BOX=0; + const uint8 CYLINDER=1; + const uint8 POLYGON=2; + }; + + struct Shape { + @verbatim (language="comment", text= + " Type of the shape") + uint8 type; + + @verbatim (language="comment", text= + " The contour of the shape (POLYGON)") + geometry_msgs::msg::Polygon footprint; + + @verbatim (language="comment", text= + " x: the length of the object (BOUNDING_BOX) or diameter (CYLINDER)" + " y: the width of the object (BOUNDING_BOX)" + " z: the overall height of the object") + geometry_msgs::msg::Vector3 dimensions; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObject.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObject.idl new file mode 100755 index 0000000..b61cfe1 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObject.idl @@ -0,0 +1,20 @@ +#include "autoware_auto_perception_msgs/msg/ObjectClassification.idl" +#include "autoware_auto_perception_msgs/msg/Shape.idl" +#include "autoware_auto_perception_msgs/msg/TrackedObjectKinematics.idl" +#include "unique_identifier_msgs/msg/UUID.idl" + +module autoware_auto_perception_msgs { + module msg { + struct TrackedObject { + unique_identifier_msgs::msg::UUID object_id; + + @range (min=0.0, max=1.0) + float existence_probability; + + sequence classification; + autoware_auto_perception_msgs::msg::TrackedObjectKinematics kinematics; + + autoware_auto_perception_msgs::msg::Shape shape; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjectKinematics.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjectKinematics.idl new file mode 100755 index 0000000..c87a81b --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjectKinematics.idl @@ -0,0 +1,46 @@ +#include "geometry_msgs/msg/AccelWithCovariance.idl" +#include "geometry_msgs/msg/Point.idl" +#include "geometry_msgs/msg/PoseWithCovariance.idl" +#include "geometry_msgs/msg/Quaternion.idl" +#include "geometry_msgs/msg/TwistWithCovariance.idl" + +module autoware_auto_perception_msgs { + module msg { + module TrackedObjectKinematics_Constants { + /** + * Only position is available, orientation is empty. Note that the shape can be an oriented + * bounding box but the direction the object is facing is unknown, in which case + * orientation should be empty. + */ + const uint8 UNAVAILABLE = 0; + /** + * The orientation is determined only up to a sign flip. For instance, assume that cars are + * longer than they are wide, and the perception pipeline can accurately estimate the + * dimensions of a car. It should set the orientation to coincide with the major axis, with + * the sign chosen arbitrarily, and use this tag to signify that the orientation could + * point to the front or the back. + */ + const uint8 SIGN_UNKNOWN = 1; + /** + * The full orientation is available. Use e.g. for machine-learning models that can + * differentiate between the front and back of a vehicle. + */ + const uint8 AVAILABLE = 2; + }; + + struct TrackedObjectKinematics { + @verbatim (language="comment", text= + " Pose covariance is always provided by tracking.") + geometry_msgs::msg::PoseWithCovariance pose_with_covariance; + + uint8 orientation_availability; + + geometry_msgs::msg::TwistWithCovariance twist_with_covariance; + + geometry_msgs::msg::AccelWithCovariance acceleration_with_covariance; + + @value (default=False) + boolean is_stationary; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjects.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjects.idl new file mode 100755 index 0000000..4be6c44 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrackedObjects.idl @@ -0,0 +1,13 @@ +#include "autoware_auto_perception_msgs/msg/TrackedObject.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " This is the output of object tracking and the input to prediction.") + struct TrackedObjects { + std_msgs::msg::Header header; + sequence objects; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLight.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLight.idl new file mode 100755 index 0000000..a0271e1 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLight.idl @@ -0,0 +1,44 @@ +module autoware_auto_perception_msgs { + module msg { + module TrafficLight_Constants { + // constants for color + const uint8 RED = 1; + const uint8 AMBER = 2; + const uint8 GREEN = 3; + const uint8 WHITE = 4; + + // constants for shape + const uint8 CIRCLE = 5; + const uint8 LEFT_ARROW = 6; + const uint8 RIGHT_ARROW = 7; + const uint8 UP_ARROW = 8; + const uint8 UP_LEFT_ARROW = 9; + const uint8 UP_RIGHT_ARROW = 10; + const uint8 DOWN_ARROW = 11; + const uint8 DOWN_LEFT_ARROW = 12; + const uint8 DOWN_RIGHT_ARROW = 13; + const uint8 CROSS = 14; + + // constants for status + const uint8 SOLID_OFF = 15; + const uint8 SOLID_ON = 16; + const uint8 FLASHING = 17; + + // constants for common use + const uint8 UNKNOWN = 18; + }; + struct TrafficLight { + @default (value=0) + uint8 color; + + @default (value=0) + uint8 shape; + + @default (value=0) + uint8 status; + + @default (value=0.0) + float confidence; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoi.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoi.idl new file mode 100755 index 0000000..10976cb --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoi.idl @@ -0,0 +1,10 @@ +#include "sensor_msgs/msg/RegionOfInterest.idl" + +module autoware_auto_perception_msgs { + module msg { + struct TrafficLightRoi { + sensor_msgs::msg::RegionOfInterest roi; + int32 id; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoiArray.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoiArray.idl new file mode 100755 index 0000000..094f485 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficLightRoiArray.idl @@ -0,0 +1,11 @@ +#include "autoware_auto_perception_msgs/msg/TrafficLightRoi.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + struct TrafficLightRoiArray { + std_msgs::msg::Header header; + sequence rois; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignal.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignal.idl new file mode 100755 index 0000000..ef17c01 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignal.idl @@ -0,0 +1,19 @@ +#include "autoware_auto_perception_msgs/msg/TrafficLight.idl" + +module autoware_auto_perception_msgs { + module msg { + @verbatim (language="comment", text= + " A TrafficSignal is defined here as a group of multiple TrafficLights" "\n" + " which each represent a single light, indicator, or bulb.") + struct TrafficSignal { + @verbatim (language="comment", text= + " A value of 0 indicates an invalid map_primitive_id. Signals which are not" + " associated with map primitives should not be used in planning because this" + " indicates that the required signal-to-lane mapping is not available.") + @default (value=0) + int32 map_primitive_id; + + sequence lights; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalArray.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalArray.idl new file mode 100755 index 0000000..22de579 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalArray.idl @@ -0,0 +1,11 @@ +#include "autoware_auto_perception_msgs/msg/TrafficSignal.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + struct TrafficSignalArray { + std_msgs::msg::Header header; + sequence signals; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalStamped.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalStamped.idl new file mode 100755 index 0000000..31a4767 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalStamped.idl @@ -0,0 +1,11 @@ +#include "autoware_auto_perception_msgs/msg/TrafficSignal.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_perception_msgs { + module msg { + struct TrafficSignalStamped { + std_msgs::msg::Header header; + autoware_auto_perception_msgs::msg::TrafficSignal signal; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalWithJudge.idl b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalWithJudge.idl new file mode 100755 index 0000000..45c61c2 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/msg/TrafficSignalWithJudge.idl @@ -0,0 +1,17 @@ +#include "autoware_auto_perception_msgs/msg/TrafficSignal.idl" + +module autoware_auto_perception_msgs { + module msg { + module TrafficSignalWithJudge_Constants { + const uint8 JUDGE = 1; + const uint8 NONE = 2; + const uint8 STOP = 3; + const uint8 GO = 4; + }; + struct TrafficSignalWithJudge { + uint8 judge; + boolean has_state; + autoware_auto_perception_msgs::msg::TrafficSignal signal; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_perception_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_perception_msgs/package.xml new file mode 100755 index 0000000..6161f05 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_perception_msgs/package.xml @@ -0,0 +1,31 @@ + + + + autoware_auto_perception_msgs + 1.0.0 + Interfaces between core Autoware.Auto perception components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + autoware_auto_geometry_msgs + geometry_msgs + sensor_msgs + std_msgs + unique_identifier_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_planning_msgs/CMakeLists.txt new file mode 100755 index 0000000..1cf6cc5 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/CMakeLists.txt @@ -0,0 +1,42 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_planning_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "action/PlannerCostmap.idl" + "action/PlanTrajectory.idl" + "action/RecordTrajectory.idl" + "action/ReplayTrajectory.idl" + "msg/HADMapRoute.idl" + "msg/OrderMovement.idl" + "msg/Route.idl" + "msg/Trajectory.idl" + "msg/TrajectoryPoint.idl" + "msg/Path.idl" + "msg/PathPoint.idl" + "msg/PathWithLaneId.idl" + "msg/PathPointWithLaneId.idl" + "srv/ModifyTrajectory.idl" + DEPENDENCIES + "autoware_auto_geometry_msgs" + "autoware_auto_mapping_msgs" + "builtin_interfaces" + "action_msgs" + "geometry_msgs" + "nav_msgs" + "std_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlanTrajectory.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlanTrajectory.idl new file mode 100755 index 0000000..a59c73f --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlanTrajectory.idl @@ -0,0 +1,27 @@ +#include "autoware_auto_planning_msgs/msg/HADMapRoute.idl" +#include "autoware_auto_planning_msgs/msg/Trajectory.idl" + +module autoware_auto_planning_msgs { + module action { + module PlanTrajectory_Result_Constants { + const uint8 SUCCESS = 0; + const uint8 FAIL = 1; + }; + struct PlanTrajectory_Goal { + autoware_auto_planning_msgs::msg::HADMapRoute sub_route; + }; + + struct PlanTrajectory_Result { + @verbatim(language = "comment", text = + "Report of end condition. Value should be one of PlanTrajectory_Constants") + uint8 result; + autoware_auto_planning_msgs::msg::Trajectory trajectory; + }; + + struct PlanTrajectory_Feedback { + @verbatim(language = "comment", text = + "Currently we don't need feedback, but we need some variable to compile") + uint8 unused_variable; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlannerCostmap.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlannerCostmap.idl new file mode 100755 index 0000000..2fd8dca --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/PlannerCostmap.idl @@ -0,0 +1,26 @@ +#include "autoware_auto_planning_msgs/msg/HADMapRoute.idl" +#include "nav_msgs/msg/OccupancyGrid.idl" +#include "std_msgs/msg/Empty.idl" + +module autoware_auto_planning_msgs { + module action { + struct PlannerCostmap_Goal + { + @verbatim(language = "comment", text = + "Route defined by start and goal point and map primitives" + "between given points.") + autoware_auto_planning_msgs::msg::HADMapRoute route; + }; + struct PlannerCostmap_Result + { + @verbatim(language = "comment", text = + "Costmap with obstacles and lanelets position applied") + nav_msgs::msg::OccupancyGrid costmap; + }; + struct PlannerCostmap_Feedback { + @verbatim(language = "comment", text = + "Currently there is no feedback, but variable is needed to compile") + std_msgs::msg::Empty unused_variable; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/RecordTrajectory.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/RecordTrajectory.idl new file mode 100755 index 0000000..2697cdb --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/RecordTrajectory.idl @@ -0,0 +1,19 @@ +module autoware_auto_planning_msgs { + module action { + struct RecordTrajectory_Goal { + @verbatim(language = "comment", text = + "A path to the CSV file which will be created to save the recorded trajectory.") + string record_path; + }; + + struct RecordTrajectory_Result { + @verbatim(language = "comment", text = + "This action has no result but we must provide something here.") + boolean unused_flag; + }; + + struct RecordTrajectory_Feedback { + int32 current_length; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/ReplayTrajectory.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/ReplayTrajectory.idl new file mode 100755 index 0000000..ab74fdd --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/action/ReplayTrajectory.idl @@ -0,0 +1,19 @@ +module autoware_auto_planning_msgs { + module action { + struct ReplayTrajectory_Goal { + @verbatim(language = "comment", text = + "A path to the CSV file which contains the recorded trajectory.") + string replay_path; + }; + + struct ReplayTrajectory_Result { + @verbatim(language = "comment", text = + "This action has no result but we must provide something here.") + boolean unused_flag; + }; + + struct ReplayTrajectory_Feedback { + int32 remaining_length; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/HADMapRoute.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/HADMapRoute.idl new file mode 100755 index 0000000..fb49654 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/HADMapRoute.idl @@ -0,0 +1,27 @@ +#include "autoware_auto_mapping_msgs/msg/HADMapSegment.idl" +#include "geometry_msgs/msg/Pose.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language="comment", text= + " A route within a high-definition map defined by" + " the start and goal points and map primitives" + " describing the route between the two.") + struct HADMapRoute { + std_msgs::msg::Header header; + + @verbatim (language="comment", text= + " The start_pose must exist within the bounds of the primitives in the first" + " segment defined in the route_segments array.") + geometry_msgs::msg::Pose start_pose; + + @verbatim (language="comment", text= + " The goal_pose must exist within the bounds of the primitives in the last" + " segment defined in the route_semgents array.") + geometry_msgs::msg::Pose goal_pose; + + sequence segments; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/OrderMovement.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/OrderMovement.idl new file mode 100755 index 0000000..6d3ea20 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/OrderMovement.idl @@ -0,0 +1,21 @@ +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + module OrderMovement_Constants { + const uint8 NOTSET = 0; + const uint8 STOP = 1; + const uint8 GO = 2; + const uint8 SLOWDOWN = 3; + }; + + @verbatim (language="comment", text= + "Movement order for planner to follow") + struct OrderMovement { + std_msgs::msg::Header header; + + @default (value=0) + uint8 order_movement; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Path.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Path.idl new file mode 100755 index 0000000..6523193 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Path.idl @@ -0,0 +1,16 @@ +#include "autoware_auto_planning_msgs/msg/PathPoint.idl" +#include "nav_msgs/msg/OccupancyGrid.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language = "comment", text= + "Contains a PathPoint path and left and right bound.") + struct Path { + std_msgs::msg::Header header; + sequence points; + sequence left_bound; + sequence right_bound; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPoint.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPoint.idl new file mode 100755 index 0000000..1ce0ea0 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPoint.idl @@ -0,0 +1,26 @@ +#include "geometry_msgs/msg/Pose.idl" +#include "geometry_msgs/msg/Twist.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language = "comment", text= + "Represents a pose from a lanelet map, contains twist information.") + struct PathPoint { + geometry_msgs::msg::Pose pose; + + @default (value=0.0) + float longitudinal_velocity_mps; + + @default (value=0.0) + float lateral_velocity_mps; + + @default (value=0.0) + float heading_rate_rps; + + @verbatim(language = "comment", text = + "Denotes that the point is final, doesn't need further updates.") + @default (value = FALSE) + boolean is_final; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPointWithLaneId.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPointWithLaneId.idl new file mode 100755 index 0000000..500c3e7 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathPointWithLaneId.idl @@ -0,0 +1,15 @@ +#include "autoware_auto_planning_msgs/msg/PathPoint.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language = "comment", text= + "Contains a PathPoint and lanelet lane_id information.") + struct PathPointWithLaneId { + autoware_auto_planning_msgs::msg::PathPoint point; + + @verbatim(language = "comment", text = + "Lanelet lane_id information.") + sequence lane_ids; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathWithLaneId.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathWithLaneId.idl new file mode 100755 index 0000000..88ec546 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/PathWithLaneId.idl @@ -0,0 +1,16 @@ +#include "autoware_auto_planning_msgs/msg/PathPointWithLaneId.idl" +#include "nav_msgs/msg/OccupancyGrid.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language = "comment", text= + "Contains a PathPointWithLaneId path and left and right bound.") + struct PathWithLaneId { + std_msgs::msg::Header header; + sequence points; + sequence left_bound; + sequence right_bound; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Route.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Route.idl new file mode 100755 index 0000000..76e0fa3 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Route.idl @@ -0,0 +1,22 @@ +#include "autoware_auto_mapping_msgs/msg/MapPrimitive.idl" +#include "autoware_auto_planning_msgs/msg/TrajectoryPoint.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + module Route_Constants { + const uint32 CAPACITY = 100; + }; + @verbatim (language="comment", text= + "Global route information for the planner") + struct Route { + std_msgs::msg::Header header; + + autoware_auto_planning_msgs::msg::TrajectoryPoint start_point; + + autoware_auto_planning_msgs::msg::TrajectoryPoint goal_point; + + sequence primitives; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Trajectory.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Trajectory.idl new file mode 100755 index 0000000..4f9381c --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/Trajectory.idl @@ -0,0 +1,17 @@ +#include "autoware_auto_planning_msgs/msg/TrajectoryPoint.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_planning_msgs { + module msg { + module Trajectory_Constants { + const uint32 CAPACITY = 10000; + }; + @verbatim (language="comment", text= + " A set of trajectory points for the controller") + struct Trajectory { + std_msgs::msg::Header header; + + sequence points; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/TrajectoryPoint.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/TrajectoryPoint.idl new file mode 100755 index 0000000..4135d10 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/msg/TrajectoryPoint.idl @@ -0,0 +1,33 @@ +#include "builtin_interfaces/msg/Duration.idl" +#include "geometry_msgs/msg/Pose.idl" + +module autoware_auto_planning_msgs { + module msg { + @verbatim (language="comment", text= + " Representation of a trajectory point for the controller") + struct TrajectoryPoint { + builtin_interfaces::msg::Duration time_from_start; + + geometry_msgs::msg::Pose pose; + + @default (value=0.0) + float longitudinal_velocity_mps; + + @default (value=0.0) + float lateral_velocity_mps; + + @default (value=0.0) + // acceleration_mps2 increases/decreases based on absolute vehicle motion and does not consider vehicle direction (forward/backward) + float acceleration_mps2; + + @default (value=0.0) + float heading_rate_rps; + + @default (value=0.0) + float front_wheel_angle_rad; + + @default (value=0.0) + float rear_wheel_angle_rad; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_planning_msgs/package.xml new file mode 100755 index 0000000..a5f129a --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/package.xml @@ -0,0 +1,33 @@ + + + + autoware_auto_planning_msgs + 1.0.0 + Interfaces between core Autoware.Auto planning components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + autoware_auto_geometry_msgs + autoware_auto_mapping_msgs + builtin_interfaces + action_msgs + geometry_msgs + nav_msgs + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_planning_msgs/srv/ModifyTrajectory.idl b/src/autoware_auto_msgs/autoware_auto_planning_msgs/srv/ModifyTrajectory.idl new file mode 100755 index 0000000..2368928 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_planning_msgs/srv/ModifyTrajectory.idl @@ -0,0 +1,18 @@ +#include "autoware_auto_planning_msgs/msg/Trajectory.idl" + +module autoware_auto_planning_msgs { + module srv { + struct ModifyTrajectory_Request + { + @verbatim(language = "comment", text = + "Trajectory to be modified") + autoware_auto_planning_msgs::msg::Trajectory original_trajectory; + }; + struct ModifyTrajectory_Response + { + @verbatim(language = "comment", text = + "Trajectory after modification") + autoware_auto_planning_msgs::msg::Trajectory modified_trajectory; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_system_msgs/CMakeLists.txt new file mode 100755 index 0000000..be95e9d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/CMakeLists.txt @@ -0,0 +1,31 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_system_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/AutowareState.idl" + "msg/ControlDiagnostic.idl" + "msg/DiagnosticHeader.idl" + "msg/DrivingCapability.idl" + "msg/EmergencyState.idl" + "msg/HazardStatus.idl" + "msg/HazardStatusStamped.idl" + DEPENDENCIES + "builtin_interfaces" + "diagnostic_msgs" + "std_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/AutowareState.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/AutowareState.idl new file mode 100755 index 0000000..bbe0c3d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/AutowareState.idl @@ -0,0 +1,26 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_system_msgs { + module msg { + module AutowareState_Constants { + const uint8 INITIALIZING = 1; + const uint8 WAITING_FOR_ROUTE = 2; + const uint8 PLANNING = 3; + const uint8 WAITING_FOR_ENGAGE = 4; + const uint8 DRIVING = 5; + const uint8 ARRIVED_GOAL = 6; + const uint8 FINALIZING = 7; + }; + + @verbatim (language="comment", text= + " A message for reporting the Autoware system status.") + struct AutowareState { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Current state of the Autoware system.") + uint8 state; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/ControlDiagnostic.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/ControlDiagnostic.idl new file mode 100755 index 0000000..524d9ad --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/ControlDiagnostic.idl @@ -0,0 +1,33 @@ +#include "autoware_auto_system_msgs/msg/DiagnosticHeader.idl" + +module autoware_auto_system_msgs { + module msg { + @verbatim (language="comment", text= + " Diagnostic information for the controller") + struct ControlDiagnostic { + autoware_auto_system_msgs::msg::DiagnosticHeader diag_header; + + @verbatim (language="comment", text= + " Controller specific information") + boolean new_trajectory; + + string<256> trajectory_source; + + string<256> pose_source; + + @verbatim (language="comment", text= + " the error between the current vehicle and the nearest neighbor point") + float lateral_error_m; + + float longitudinal_error_m; + + float velocity_error_mps; + + float acceleration_error_mps2; + + float yaw_error_rad; + + float yaw_rate_error_rps; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DiagnosticHeader.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DiagnosticHeader.idl new file mode 100755 index 0000000..2768603 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DiagnosticHeader.idl @@ -0,0 +1,20 @@ +#include "builtin_interfaces/msg/Duration.idl" +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_system_msgs { + module msg { + @verbatim (language="comment", text= + " Base information that all diagnostic messages should have") + struct DiagnosticHeader { + string<256> name; + + builtin_interfaces::msg::Time data_stamp; + + builtin_interfaces::msg::Time computation_start; + + builtin_interfaces::msg::Duration runtime; + + uint32 iterations; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DrivingCapability.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DrivingCapability.idl new file mode 100755 index 0000000..0066cf5 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/DrivingCapability.idl @@ -0,0 +1,22 @@ +#include "builtin_interfaces/msg/Time.idl" +#include "autoware_auto_system_msgs/msg/HazardStatus.idl" + +module autoware_auto_system_msgs { + module msg { + + @verbatim (language="comment", text= + " A status message for reporting the vehicle driving capabilities.") + struct DrivingCapability { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Status for the autonomous driving mode.") + autoware_auto_system_msgs::msg::HazardStatus autonomous_driving; + + @verbatim (language="comment", text= + " Status for the remote control mode.") + autoware_auto_system_msgs::msg::HazardStatus remote_control; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/EmergencyState.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/EmergencyState.idl new file mode 100755 index 0000000..709ff59 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/EmergencyState.idl @@ -0,0 +1,30 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_system_msgs { + module msg { + + module EmergencyState_Constants { + const uint8 NORMAL = 1; + const uint8 OVERRIDE_REQUESTING = 2; + const uint8 MRM_OPERATING = 3; + const uint8 MRM_SUCCEEDED = 4; + const uint8 MRM_FAILED = 5; + }; + + @verbatim (language="comment", text= + " Message for reporting the emergency state.") + struct EmergencyState { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Current emergency state fo the system. Possible states are as follows." + " - NORMAL - the system is not in emergency mode." + " - OVERRIDE_REQUESTING - the override is requesting." + " - MRM_OPERATING - during the minimal risk maneuver (MRM)" + " - MRM_SUCCEEDED - MRM operation succeeded." + " - MRM_FAILED - MRM operation failed.") + uint8 state; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatus.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatus.idl new file mode 100755 index 0000000..057ada7 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatus.idl @@ -0,0 +1,49 @@ +#include "diagnostic_msgs/msg/DiagnosticStatus.idl" + +module autoware_auto_system_msgs { + module msg { + module HazardStatus_Constants { + const uint8 NO_FAULT = 0; + const uint8 SAFE_FAULT = 1; + const uint8 LATENT_FAULT = 2; + const uint8 SINGLE_POINT_FAULT = 3; + }; + + @verbatim (language="comment", text= + " A message for reporting the hazard status.") + struct HazardStatus { + + @verbatim (language="comment", text= + " Determines the hazard level.") + @default (value=0) + uint8 level; + + @verbatim (language="comment", text= + " Determines whether the vehicle is in the emergency state.") + @default (value=FALSE) + boolean emergency; + + @verbatim (language="comment", text= + " Determines whether the vehicle emergency state should be held.") + @default (value=FALSE) + boolean emergency_holding; + + @verbatim (language="comment", text= + " Diagnostics categorized as no fault.") + sequence diag_no_fault; + + @verbatim (language="comment", text= + " Diagnostics categorized as safe fault.") + sequence diag_safe_fault; + + @verbatim (language="comment", text= + " Diagnostics categorized as latent fault.") + sequence diag_latent_fault; + + @verbatim (language="comment", text= + " Diagnostics categorized as single point fault.") + sequence diag_single_point_fault; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatusStamped.idl b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatusStamped.idl new file mode 100755 index 0000000..91a42b6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/msg/HazardStatusStamped.idl @@ -0,0 +1,18 @@ +#include "builtin_interfaces/msg/Time.idl" +#include "autoware_auto_system_msgs/msg/HazardStatus.idl" + +module autoware_auto_system_msgs { + module msg { + + @verbatim (language="comment", text= + " A message for reporting the hazard status with timestamp.") + struct HazardStatusStamped { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Contains the hazard status with diagnostics information.") + autoware_auto_system_msgs::msg::HazardStatus status; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_system_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_system_msgs/package.xml new file mode 100755 index 0000000..a017f62 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_system_msgs/package.xml @@ -0,0 +1,29 @@ + + + + autoware_auto_system_msgs + 1.0.0 + Interfaces between core Autoware.Auto system components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + builtin_interfaces + diagnostic_msgs + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/CMakeLists.txt b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/CMakeLists.txt new file mode 100755 index 0000000..cece6a6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/CMakeLists.txt @@ -0,0 +1,53 @@ +# All rights reserved. +cmake_minimum_required(VERSION 3.5) + +### Export headers +project(autoware_auto_vehicle_msgs) + +# Generate messages +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/ControlModeCommand.idl" + "msg/ControlModeReport.idl" + "msg/Engage.idl" + "msg/GearCommand.idl" + "msg/GearReport.idl" + "msg/HandBrakeCommand.idl" + "msg/HandBrakeReport.idl" + "msg/HazardLightsCommand.idl" + "msg/HazardLightsReport.idl" + "msg/HeadlightsCommand.idl" + "msg/HeadlightsReport.idl" + "msg/HornCommand.idl" + "msg/HornReport.idl" + "msg/RawControlCommand.idl" + "msg/StationaryLockingCommand.idl" + "msg/SteeringReport.idl" + "msg/TurnIndicatorsCommand.idl" + "msg/TurnIndicatorsReport.idl" + "msg/VehicleControlCommand.idl" + "msg/VehicleKinematicState.idl" + "msg/VehicleOdometry.idl" + "msg/VehicleStateCommand.idl" + "msg/VehicleStateReport.idl" + "msg/VelocityReport.idl" + "msg/WheelEncoder.idl" + "msg/WipersCommand.idl" + "msg/WipersReport.idl" + "srv/AutonomyModeChange.idl" + "srv/ControlModeCommand.srv" + DEPENDENCIES + "autoware_auto_planning_msgs" + "builtin_interfaces" + "std_msgs" + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package() diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeCommand.idl new file mode 100755 index 0000000..c365de6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeCommand.idl @@ -0,0 +1,19 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module ControlModeCommand_Constants { + const uint8 NO_COMMAND = 0; + const uint8 AUTONOMOUS = 1; + const uint8 MANUAL = 2; + }; + @verbatim (language="comment", text= + " ControlModeCommand.msg") + struct ControlModeCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 mode; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeReport.idl new file mode 100755 index 0000000..3ab71f5 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/ControlModeReport.idl @@ -0,0 +1,24 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module ControlModeReport_Constants { + const uint8 NO_COMMAND = 0; + const uint8 AUTONOMOUS = 1; + const uint8 AUTONOMOUS_STEER_ONLY = 2; + const uint8 AUTONOMOUS_VELOCITY_ONLY = 3; + const uint8 MANUAL = 4; + const uint8 DISENGAGED = 5; + const uint8 NOT_READY = 6; + }; + @verbatim (language="comment", text= + " ControlModeReport.msg") + + struct ControlModeReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 mode; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/Engage.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/Engage.idl new file mode 100755 index 0000000..316883e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/Engage.idl @@ -0,0 +1,18 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + + @verbatim (language="comment", text= + " Command for controlling the engagement state of the vehicle.") + struct Engage { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Determines if a vehicle should be engaged.") + @default (value=FALSE) + boolean engage; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearCommand.idl new file mode 100755 index 0000000..a0f606a --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearCommand.idl @@ -0,0 +1,40 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module GearCommand_Constants { + const uint8 NONE = 0; + const uint8 NEUTRAL = 1; + const uint8 DRIVE = 2; + const uint8 DRIVE_2 = 3; + const uint8 DRIVE_3 = 4; + const uint8 DRIVE_4 = 5; + const uint8 DRIVE_5 = 6; + const uint8 DRIVE_6 = 7; + const uint8 DRIVE_7 = 8; + const uint8 DRIVE_8 = 9; + const uint8 DRIVE_9 = 10; + const uint8 DRIVE_10 = 11; + const uint8 DRIVE_11 = 12; + const uint8 DRIVE_12 = 13; + const uint8 DRIVE_13 = 14; + const uint8 DRIVE_14 = 15; + const uint8 DRIVE_15 = 16; + const uint8 DRIVE_16 = 17; + const uint8 DRIVE_17 = 18; + const uint8 DRIVE_18 = 19; + const uint8 REVERSE = 20; + const uint8 REVERSE_2 = 21; + const uint8 PARK = 22; + const uint8 LOW = 23; + const uint8 LOW_2 = 24; + }; + + struct GearCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 command; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearReport.idl new file mode 100755 index 0000000..d82c4de --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/GearReport.idl @@ -0,0 +1,40 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module GearReport_Constants { + const uint8 NONE = 0; + const uint8 NEUTRAL = 1; + const uint8 DRIVE = 2; + const uint8 DRIVE_2 = 3; + const uint8 DRIVE_3 = 4; + const uint8 DRIVE_4 = 5; + const uint8 DRIVE_5 = 6; + const uint8 DRIVE_6 = 7; + const uint8 DRIVE_7 = 8; + const uint8 DRIVE_8 = 9; + const uint8 DRIVE_9 = 10; + const uint8 DRIVE_10 = 11; + const uint8 DRIVE_11 = 12; + const uint8 DRIVE_12 = 13; + const uint8 DRIVE_13 = 14; + const uint8 DRIVE_14 = 15; + const uint8 DRIVE_15 = 16; + const uint8 DRIVE_16 = 17; + const uint8 DRIVE_17 = 18; + const uint8 DRIVE_18 = 19; + const uint8 REVERSE = 20; + const uint8 REVERSE_2 = 21; + const uint8 PARK = 22; + const uint8 LOW = 23; + const uint8 LOW_2 = 24; + }; + + struct GearReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 report; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeCommand.idl new file mode 100755 index 0000000..5552082 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeCommand.idl @@ -0,0 +1,16 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " Command for controlling an electronic hand brake.") + + struct HandBrakeCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=FALSE) + boolean active; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeReport.idl new file mode 100755 index 0000000..6360f82 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HandBrakeReport.idl @@ -0,0 +1,13 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + struct HandBrakeReport { + builtin_interfaces::msg::Time stamp; + + @default (value=FALSE) + boolean report; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsCommand.idl new file mode 100755 index 0000000..dc09411 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsCommand.idl @@ -0,0 +1,22 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module HazardLightsCommand_Constants { + const uint8 NO_COMMAND = 0; + const uint8 DISABLE = 1; + const uint8 ENABLE = 2; + }; + + @verbatim (language="comment", text= + " Command for controlling a vehicle's hazard lights.") + + struct HazardLightsCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 command; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsReport.idl new file mode 100755 index 0000000..c85d0ea --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HazardLightsReport.idl @@ -0,0 +1,18 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module HazardLightsReport_Constants { + const uint8 DISABLE = 1; + const uint8 ENABLE = 2; + }; + + struct HazardLightsReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 report; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsCommand.idl new file mode 100755 index 0000000..6cf67ff --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsCommand.idl @@ -0,0 +1,23 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module HeadlightsCommand_Constants { + const uint8 NO_COMMAND = 0; + const uint8 DISABLE = 1; + const uint8 ENABLE_LOW = 2; + const uint8 ENABLE_HIGH = 3; + }; + + @verbatim (language="comment", text= + " Command for controlling headlights.") + + struct HeadlightsCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 command; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsReport.idl new file mode 100755 index 0000000..498e58c --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HeadlightsReport.idl @@ -0,0 +1,18 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module HeadlightsReport_Constants { + const uint8 DISABLE = 1; + const uint8 ENABLE_LOW = 2; + const uint8 ENABLE_HIGH = 3; + }; + + struct HeadlightsReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 report; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornCommand.idl new file mode 100755 index 0000000..c27d6ed --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornCommand.idl @@ -0,0 +1,16 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " Command for controlling a horn.") + + struct HornCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=FALSE) + boolean active; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornReport.idl new file mode 100755 index 0000000..b4c3fef --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/HornReport.idl @@ -0,0 +1,13 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + struct HornReport { + builtin_interfaces::msg::Time stamp; + + @default (value=FALSE) + boolean report; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/RawControlCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/RawControlCommand.idl new file mode 100755 index 0000000..1bebaeb --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/RawControlCommand.idl @@ -0,0 +1,21 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + struct RawControlCommand { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Units for all below fields are not defined. The exact semantics for each field is defined by each" "\n" + " vehicle interface implementation. It is the system integrator's responsibility to ensure these are" "\n" + " consistent when using this interface") + uint32 throttle; + + uint32 brake; + + int32 front_steer; + + int32 rear_steer; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/StationaryLockingCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/StationaryLockingCommand.idl new file mode 100755 index 0000000..6ff96a7 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/StationaryLockingCommand.idl @@ -0,0 +1,20 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " Command to avoid stationary locking \(Park gear, Parking Brake, etc.\)." + " This command assumes that the VehicleInterface or lower levels are controlling" + " the mechanism by which a vehicle is prevented from moving \(\"stationary locking\"\)" + " and will automatically attempt to apply stationary locking if a 0-velocity command" + " is applied for an arbitrary period of time. Setting the avoid_stationary_locking" + " field to TRUE tells the VehicleInterface or lower levels to avoid making this transition.") + + struct StationaryLockingCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=FALSE) + boolean avoid_stationary_locking; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/SteeringReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/SteeringReport.idl new file mode 100755 index 0000000..ed6a054 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/SteeringReport.idl @@ -0,0 +1,17 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " SteeringReport.msg") + struct SteeringReport { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " Desired angle of the steering tire in radians left (positive)" + " or right (negative) of center (0.0)") + @default (value=0.0) + float steering_tire_angle; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsCommand.idl new file mode 100755 index 0000000..1e1059f --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsCommand.idl @@ -0,0 +1,23 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module TurnIndicatorsCommand_Constants { + const uint8 NO_COMMAND = 0; + const uint8 DISABLE = 1; + const uint8 ENABLE_LEFT = 2; + const uint8 ENABLE_RIGHT = 3; + }; + + @verbatim (language="comment", text= + " Command for controlling turn indicators.") + + struct TurnIndicatorsCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 command; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsReport.idl new file mode 100755 index 0000000..3b1cf6e --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/TurnIndicatorsReport.idl @@ -0,0 +1,19 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module TurnIndicatorsReport_Constants { + const uint8 DISABLE = 1; + const uint8 ENABLE_LEFT = 2; + const uint8 ENABLE_RIGHT = 3; + }; + + struct TurnIndicatorsReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 report; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleControlCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleControlCommand.idl new file mode 100755 index 0000000..ebcc6a0 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleControlCommand.idl @@ -0,0 +1,27 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " Information that is sent to Vehicle interface") + struct VehicleControlCommand { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " should be negative when reversed") + @default (value=0.0) + float long_accel_mps2; + + @verbatim (language="comment", text= + " should be negative when reversed") + @default (value=0.0) + float velocity_mps; + + @default (value=0.0) + float front_wheel_angle_rad; + + @default (value=0.0) + float rear_wheel_angle_rad; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleKinematicState.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleKinematicState.idl new file mode 100755 index 0000000..f158928 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleKinematicState.idl @@ -0,0 +1,18 @@ +#include "autoware_auto_planning_msgs/msg/TrajectoryPoint.idl" +#include "geometry_msgs/msg/Transform.idl" +#include "std_msgs/msg/Header.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " VehicleKinematicState.msg" "\n" + " Representation of a trajectory point with timestamp for the controller") + struct VehicleKinematicState { + std_msgs::msg::Header header; + + autoware_auto_planning_msgs::msg::TrajectoryPoint state; + + geometry_msgs::msg::Transform delta; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleOdometry.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleOdometry.idl new file mode 100755 index 0000000..50c699d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleOdometry.idl @@ -0,0 +1,20 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " VehicleOdometry.msg") + struct VehicleOdometry { + builtin_interfaces::msg::Time stamp; + + @default (value=0.0) + float velocity_mps; + + @default (value=0.0) + float front_wheel_angle_rad; + + @default (value=0.0) + float rear_wheel_angle_rad; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateCommand.idl new file mode 100755 index 0000000..3cba7ca --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateCommand.idl @@ -0,0 +1,57 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module VehicleStateCommand_Constants { + const uint8 BLINKER_NO_COMMAND = 0; + const uint8 BLINKER_OFF = 1; + const uint8 BLINKER_LEFT = 2; + const uint8 BLINKER_RIGHT = 3; + const uint8 BLINKER_HAZARD = 4; + const uint8 HEADLIGHT_NO_COMMAND = 0; + const uint8 HEADLIGHT_OFF = 1; + const uint8 HEADLIGHT_ON = 2; + const uint8 HEADLIGHT_HIGH = 3; + const uint8 WIPER_NO_COMMAND = 0; + const uint8 WIPER_OFF = 1; + const uint8 WIPER_LOW = 2; + const uint8 WIPER_HIGH = 3; + const uint8 WIPER_CLEAN = 14; // Match WipersCommand::ENABLE_CLEAN + const uint8 GEAR_NO_COMMAND = 0; + const uint8 GEAR_DRIVE = 1; + const uint8 GEAR_REVERSE = 2; + const uint8 GEAR_PARK = 3; + const uint8 GEAR_LOW = 4; + const uint8 GEAR_NEUTRAL = 5; + const uint8 MODE_NO_COMMAND = 0; + const uint8 MODE_AUTONOMOUS = 1; + const uint8 MODE_MANUAL = 2; + }; + @verbatim (language="comment", text= + " VehicleStateCommand.msg") + struct VehicleStateCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 blinker; + + @default (value=0) + uint8 headlight; + + @default (value=0) + uint8 wiper; + + @default (value=0) + uint8 gear; + + @default (value=0) + uint8 mode; + + @default (value=FALSE) + boolean hand_brake; + + @default (value=FALSE) + boolean horn; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateReport.idl new file mode 100755 index 0000000..1a85fa4 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VehicleStateReport.idl @@ -0,0 +1,50 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module VehicleStateReport_Constants { + const uint8 BLINKER_OFF = 1; + const uint8 BLINKER_LEFT = 2; + const uint8 BLINKER_RIGHT = 3; + const uint8 BLINKER_HAZARD = 4; + const uint8 HEADLIGHT_OFF = 1; + const uint8 HEADLIGHT_ON = 2; + const uint8 HEADLIGHT_HIGH = 3; + const uint8 WIPER_OFF = 1; + const uint8 WIPER_LOW = 2; + const uint8 WIPER_HIGH = 3; + const uint8 WIPER_CLEAN = 14; // Match WipersCommand::ENABLE_CLEAN + const uint8 GEAR_DRIVE = 1; + const uint8 GEAR_REVERSE = 2; + const uint8 GEAR_PARK = 3; + const uint8 GEAR_LOW = 4; + const uint8 GEAR_NEUTRAL = 5; + const uint8 MODE_AUTONOMOUS = 1; + const uint8 MODE_MANUAL = 2; + const uint8 MODE_DISENGAGED = 3; + const uint8 MODE_NOT_READY = 4; + }; + + struct VehicleStateReport { + builtin_interfaces::msg::Time stamp; + + @verbatim (language="comment", text= + " 0 to 100") + uint8 fuel; + + uint8 blinker; + + uint8 headlight; + + uint8 wiper; + + uint8 gear; + + uint8 mode; + + boolean hand_brake; + + boolean horn; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VelocityReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VelocityReport.idl new file mode 100755 index 0000000..04f3202 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/VelocityReport.idl @@ -0,0 +1,20 @@ +#include "std_msgs/msg/Header.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + " VelocityReport.msg") + struct VelocityReport { + std_msgs::msg::Header header; + + @default (value=0.0) + float longitudinal_velocity; + + @default (value=0.0) + float lateral_velocity; + + @default (value=0.0) + float heading_rate; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WheelEncoder.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WheelEncoder.idl new file mode 100755 index 0000000..17f00f1 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WheelEncoder.idl @@ -0,0 +1,17 @@ +#include "std_msgs/msg/Header.idl" + +module autoware_auto_vehicle_msgs { + module msg { + @verbatim (language="comment", text= + "Representation of a wheel-encoder measurement") + struct WheelEncoder { + std_msgs::msg::Header header; + + @verbatim (language="comment", text= + " Negative speed values indicate rotation in the opposite " "\n" + " direction of the normal direction of travel of the vehicle.") + @default (value=0.0) + float speed_mps; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersCommand.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersCommand.idl new file mode 100755 index 0000000..9632299 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersCommand.idl @@ -0,0 +1,38 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module WipersCommand_Constants { + const uint8 NO_COMMAND = 0; + const uint8 DISABLE = 1; + const uint8 ENABLE_LOW = 2; + const uint8 ENABLE_HIGH = 3; + const uint8 ENABLE_INT_1 = 4; + const uint8 ENABLE_INT_2 = 5; + const uint8 ENABLE_INT_3 = 6; + const uint8 ENABLE_INT_4 = 7; + const uint8 ENABLE_INT_5 = 8; + const uint8 ENABLE_INT_6 = 9; + const uint8 ENABLE_INT_7 = 10; + const uint8 ENABLE_INT_8 = 11; + const uint8 ENABLE_INT_9 = 12; + const uint8 ENABLE_INT_10 = 13; + const uint8 ENABLE_CLEAN = 14; + }; + + @verbatim (language="comment", text= + " Command for controlling a wiper or group of wipers.") + + @verbatim (language="comment", text= + " Each wiper or group of simultaneously-controlled wipers" + " should have their own topic which receives this message.") + + struct WipersCommand { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 command; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersReport.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersReport.idl new file mode 100755 index 0000000..f5ceb7d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/msg/WipersReport.idl @@ -0,0 +1,34 @@ +#include "builtin_interfaces/msg/Time.idl" + +module autoware_auto_vehicle_msgs { + module msg { + module WipersReport_Constants { + const uint8 DISABLE = 1; + const uint8 ENABLE_LOW = 2; + const uint8 ENABLE_HIGH = 3; + const uint8 ENABLE_INT_1 = 4; + const uint8 ENABLE_INT_2 = 5; + const uint8 ENABLE_INT_3 = 6; + const uint8 ENABLE_INT_4 = 7; + const uint8 ENABLE_INT_5 = 8; + const uint8 ENABLE_INT_6 = 9; + const uint8 ENABLE_INT_7 = 10; + const uint8 ENABLE_INT_8 = 11; + const uint8 ENABLE_INT_9 = 12; + const uint8 ENABLE_INT_10 = 13; + const uint8 ENABLE_CLEAN = 14; + }; + + @verbatim (language="comment", text= + " Each wiper or group of simultaneously-controlled wipers" + " should have their own topic which receives this message.") + + struct WipersReport { + builtin_interfaces::msg::Time stamp; + + @default (value=0) + uint8 report; + }; + }; +}; + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/package.xml b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/package.xml new file mode 100755 index 0000000..ff6db6d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/package.xml @@ -0,0 +1,29 @@ + + + + autoware_auto_vehicle_msgs + 1.0.0 + Interfaces between core Autoware.Auto vehicle components + Apex.AI, Inc. + Apache 2 + + ament_cmake_auto + + rosidl_default_generators + + autoware_auto_planning_msgs + builtin_interfaces + std_msgs + + rosidl_default_runtime + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + + diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/AutonomyModeChange.idl b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/AutonomyModeChange.idl new file mode 100755 index 0000000..7be179d --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/AutonomyModeChange.idl @@ -0,0 +1,22 @@ +#include "std_msgs/msg/Empty.idl" + +module autoware_auto_vehicle_msgs { + module srv { + module AutonomyModeChange_Request_Constants { + const uint8 MODE_MANUAL = 0; + const uint8 MODE_AUTONOMOUS = 1; + }; + struct AutonomyModeChange_Request + { + @verbatim(language = "comment", text = + "The desired autonomy mode") + uint8 mode; + }; + struct AutonomyModeChange_Response + { + @verbatim(language = "comment", text = + "No response is used because changing the autonomy mode requires non-trivial time") + std_msgs::msg::Empty empty; + }; + }; +}; diff --git a/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/ControlModeCommand.srv b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/ControlModeCommand.srv new file mode 100755 index 0000000..988a7a6 --- /dev/null +++ b/src/autoware_auto_msgs/autoware_auto_vehicle_msgs/srv/ControlModeCommand.srv @@ -0,0 +1,12 @@ +uint8 NO_COMMAND = 0 +uint8 AUTONOMOUS = 1 +uint8 AUTONOMOUS_STEER_ONLY = 2 +uint8 AUTONOMOUS_VELOCITY_ONLY = 3 +uint8 MANUAL = 4 + +builtin_interfaces/Time stamp +uint8 mode + +--- + +bool success diff --git a/src/autoware_auto_msgs/build_depends.repos b/src/autoware_auto_msgs/build_depends.repos new file mode 100755 index 0000000..56f46b6 --- /dev/null +++ b/src/autoware_auto_msgs/build_depends.repos @@ -0,0 +1 @@ +repositories: diff --git a/src/novatel_oem7_msgs/CHANGELOG.rst b/src/novatel_oem7_msgs/CHANGELOG.rst new file mode 100755 index 0000000..0d46488 --- /dev/null +++ b/src/novatel_oem7_msgs/CHANGELOG.rst @@ -0,0 +1,23 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package novatel_oem7_msgs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +20.6.0 (2025-01-30) +-------------------- +Various QoL changes + +* BESTGNSSVEL, INSPVASX Oem7 Messages + + +20.0.0 (2023-04-18) +-------------------- +Formal support for Humble; functionality updated to that of ROS1 v4.2.0 + + +* BESTGNSSPOS, PPPPOS, TERRASTARINFO, TERRASTARSTATUS Oem7 Messages + + +10.0.0 (2021-08-31) +-------------------- +Initial Support for ROS2/Foxy + diff --git a/src/novatel_oem7_msgs/CMakeLists.txt b/src/novatel_oem7_msgs/CMakeLists.txt new file mode 100755 index 0000000..7990ac1 --- /dev/null +++ b/src/novatel_oem7_msgs/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.10) +project(novatel_oem7_msgs) + + +set(CMAKE_CXX_STANDARD 14) + +set(MSG_DEPS std_msgs) + + +find_package(ament_cmake REQUIRED) +find_package(rosidl_default_generators REQUIRED) +find_package(std_msgs REQUIRED) + + +set(MSG_FILES + srv/Oem7AbasciiCmd.srv + msg/Oem7RawMsg.msg + msg/Oem7Header.msg + msg/BESTPOS.msg + msg/BESTUTM.msg + msg/BESTVEL.msg + msg/BESTGNSSPOS.msg + msg/BESTGNSSVEL.msg + msg/PPPPOS.msg + msg/HEADING2.msg + msg/INSCONFIG.msg + msg/INSPVA.msg + msg/INSPVAX.msg + msg/INSSTDEV.msg + msg/CORRIMU.msg + msg/IMURATECORRIMU.msg + msg/RXSTATUS.msg + msg/TERRASTARSTATUS.msg + msg/TERRASTARINFO.msg + msg/TIME.msg + msg/INSExtendedSolutionStatus.msg + msg/INSFrame.msg + msg/INSReceiverStatus.msg + msg/INSResetType.msg + msg/INSSourceStatus.msg + msg/INSUpdate.msg + msg/RAWIMUSX.msg + msg/BestExtendedSolutionStatus.msg + msg/InertialSolutionStatus.msg + msg/INSAlignmentMode.msg + msg/INSOutputFrame.msg + msg/PositionOrVelocityType.msg + msg/Rotation.msg + msg/RotationalOffset.msg + msg/SolutionStatus.msg + msg/SolutionSource.msg + msg/Translation.msg + msg/TranslationOffset.msg + msg/SubscriptionPermission.msg + msg/SubscriptionType.msg + msg/SyncState.msg + msg/RegionRestriction.msg + msg/LocalAreaStatus.msg + msg/AccessStatus.msg + msg/GeogatingStatus.msg +) + +rosidl_generate_interfaces(${PROJECT_NAME} + ${MSG_FILES} + DEPENDENCIES ${MSG_DEPS} +) + + +ament_export_dependencies(rosidl_default_runtime) +ament_package() diff --git a/src/novatel_oem7_msgs/msg/AccessStatus.msg b/src/novatel_oem7_msgs/msg/AccessStatus.msg new file mode 100755 index 0000000..3fa58d7 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/AccessStatus.msg @@ -0,0 +1,5 @@ +uint32 DISABLE = 0 +uint32 ENABLE = 1 + + +uint32 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/BESTGNSSPOS.msg b/src/novatel_oem7_msgs/msg/BESTGNSSPOS.msg new file mode 100755 index 0000000..bdbc063 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BESTGNSSPOS.msg @@ -0,0 +1,23 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType pos_type +float64 lat +float64 lon +float64 hgt +float32 undulation +uint32 datum_id +float32 lat_stdev +float32 lon_stdev +float32 hgt_stdev +string stn_id +float32 diff_age +float32 sol_age +uint8 num_svs +uint8 num_sol_svs +uint8 num_sol_l1_svs +uint8 num_sol_multi_svs +uint8 reserved +BestExtendedSolutionStatus ext_sol_stat +uint8 galileo_beidou_sig_mask +uint8 gps_glonass_sig_mask \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/BESTGNSSVEL.msg b/src/novatel_oem7_msgs/msg/BESTGNSSVEL.msg new file mode 100755 index 0000000..b8abbba --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BESTGNSSVEL.msg @@ -0,0 +1,10 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType vel_type +float32 latency +float32 diff_age +float64 hor_speed +float64 trk_gnd +float64 ver_speed +float32 reserved diff --git a/src/novatel_oem7_msgs/msg/BESTPOS.msg b/src/novatel_oem7_msgs/msg/BESTPOS.msg new file mode 100755 index 0000000..f5b7cd2 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BESTPOS.msg @@ -0,0 +1,29 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType pos_type +float64 lat +float64 lon +float64 hgt +float32 undulation +uint32 datum_id +float32 lat_stdev +float32 lon_stdev +float32 hgt_stdev +int8[4] stn_id +float32 diff_age +float32 sol_age +uint8 num_svs +uint8 num_sol_svs +uint8 num_sol_l1_svs +uint8 num_sol_multi_svs +uint8 reserved +BestExtendedSolutionStatus ext_sol_stat +uint8 galileo_beidou_sig_mask +uint8 gps_glonass_sig_mask + + + + + + diff --git a/src/novatel_oem7_msgs/msg/BESTUTM.msg b/src/novatel_oem7_msgs/msg/BESTUTM.msg new file mode 100755 index 0000000..97950e8 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BESTUTM.msg @@ -0,0 +1,26 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType pos_type +uint32 lon_zone_number +uint32 lat_zone_letter +float64 northing +float64 easting +float64 height +float32 undulation +uint32 datum_id +float32 northing_stddev +float32 easting_stddev +float32 height_stddev +int8[4] stn_id +float32 diff_age +float32 sol_age +uint8 num_svs +uint8 num_sol_svs +uint8 num_sol_ggl1_svs +uint8 num_sol_multi_svs +uint8 reserved +BestExtendedSolutionStatus ext_sol_stat +uint8 galileo_beidou_sig_mask +uint8 gps_glonass_sig_mask + diff --git a/src/novatel_oem7_msgs/msg/BESTVEL.msg b/src/novatel_oem7_msgs/msg/BESTVEL.msg new file mode 100755 index 0000000..6c913ac --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BESTVEL.msg @@ -0,0 +1,11 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType vel_type +float32 latency +float32 diff_age +float64 hor_speed +float64 trk_gnd +float64 ver_speed +float32 reserved + diff --git a/src/novatel_oem7_msgs/msg/BestExtendedSolutionStatus.msg b/src/novatel_oem7_msgs/msg/BestExtendedSolutionStatus.msg new file mode 100755 index 0000000..5f8227f --- /dev/null +++ b/src/novatel_oem7_msgs/msg/BestExtendedSolutionStatus.msg @@ -0,0 +1,26 @@ +# Bit 0 +uint8 RTK_SOLUTION_VERIFIED = 1 +uint8 PDP_SOLUTION_IS_GLIDE = 1 + +# Bits 1-3, mask 0xE +uint8 KLOBUCHAR_BROADCAST = 2 # 0x2 +uint8 SBAS_BROADCAST = 4 # 0x4 +uint8 MULTI_FREQUENCY_COMPUTED = 6 # 0x6 +uint8 PSRDIFF_CORRECTION = 8 # 0x8 +uint8 NOVATEL_BLENDED_IONO_VALUE = 10 #0xA + +# Bit 4 +uint8 RTK_ASSIST_ACTIVE = 16 # 0x10 + +# Bit 5 +uint8 ANTENNA_INFORMATION_IS_MISSING = 32 # 0x20 + +# Bit 6 reserved +uint8 RESERVED = 64 # 0x40 + +# Bit 7 +uint8 POSITION_INCLUDES_TERRAIN_COMPENSATION_CORRECTIONS = 128 # 0x80 + + + +uint8 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/CORRIMU.msg b/src/novatel_oem7_msgs/msg/CORRIMU.msg new file mode 100755 index 0000000..a5130f2 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/CORRIMU.msg @@ -0,0 +1,11 @@ +std_msgs/Header header +Oem7Header nov_header +uint32 imu_data_count +float64 pitch_rate +float64 roll_rate +float64 yaw_rate +float64 lateral_acc +float64 longitudinal_acc +float64 vertical_acc +uint32 reserved1 +uint32 reserved2 diff --git a/src/novatel_oem7_msgs/msg/GeogatingStatus.msg b/src/novatel_oem7_msgs/msg/GeogatingStatus.msg new file mode 100755 index 0000000..947be10 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/GeogatingStatus.msg @@ -0,0 +1,9 @@ +uint32 DISABLED = 0 +uint32 WAITING_FOR_POSITION = 1 +uint32 ONSHORE = 129 +uint32 OFFSHORE = 130 +uint32 POSITION_TOO_OLD = 255 +uint32 PROCESSING = 1000 + + +uint32 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/HEADING2.msg b/src/novatel_oem7_msgs/msg/HEADING2.msg new file mode 100755 index 0000000..60af1e1 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/HEADING2.msg @@ -0,0 +1,24 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType pos_type +float32 length +float32 heading +float32 pitch +float32 reserved +float32 heading_stdev +float32 pitch_stdev +int8[4] rover_stn_id +int8[4] master_stn_id +uint8 num_sv_tracked +uint8 num_sv_in_sol +uint8 num_sv_obs +uint8 num_sv_multi +SolutionSource sol_source +BestExtendedSolutionStatus ext_sol_status +uint8 galileo_beidou_sig_mask +uint8 gps_glonass_sig_mask + + + + diff --git a/src/novatel_oem7_msgs/msg/IMURATECORRIMU.msg b/src/novatel_oem7_msgs/msg/IMURATECORRIMU.msg new file mode 100755 index 0000000..70e1a55 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/IMURATECORRIMU.msg @@ -0,0 +1,10 @@ +std_msgs/Header header +Oem7Header nov_header +uint32 week +float64 seconds +float64 pitch_rate +float64 roll_rate +float64 yaw_rate +float64 lateral_acc +float64 longitudinal_acc +float64 vertical_acc diff --git a/src/novatel_oem7_msgs/msg/INSAlignmentMode.msg b/src/novatel_oem7_msgs/msg/INSAlignmentMode.msg new file mode 100755 index 0000000..6634eb7 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSAlignmentMode.msg @@ -0,0 +1,9 @@ + + +uint32 UNAIDED = 0 +uint32 AIDED_TRANSFER = 2 +uint32 AUTOMATIC = 3 +uint32 STATIC = 4 +uint32 KINEMATIC = 5 + +uint32 mode diff --git a/src/novatel_oem7_msgs/msg/INSCONFIG.msg b/src/novatel_oem7_msgs/msg/INSCONFIG.msg new file mode 100755 index 0000000..313cefd --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSCONFIG.msg @@ -0,0 +1,33 @@ +std_msgs/Header header +Oem7Header nov_header +uint32 imu_type +uint8 mapping +uint8 initial_alignment_velocity +uint16 heave_window +uint32 profile +uint8[4] enabled_updates +INSAlignmentMode alignment_mode +INSOutputFrame relative_ins_output_frame +bool relative_ins_output_direction +INSReceiverStatus ins_receiver_status +uint8 ins_seed_enabled +uint8 ins_seed_validation +uint16 reserved_1 +uint32 reserved_2 +uint32 reserved_3 +uint32 reserved_4 +uint32 reserved_5 +uint32 reserved_6 +uint32 reserved_7 +uint32 number_of_translations +Translation[] translations +uint32 number_of_rotations +Rotation[] rotations + + + + + + + + diff --git a/src/novatel_oem7_msgs/msg/INSExtendedSolutionStatus.msg b/src/novatel_oem7_msgs/msg/INSExtendedSolutionStatus.msg new file mode 100755 index 0000000..11ddca6 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSExtendedSolutionStatus.msg @@ -0,0 +1,56 @@ + +uint32 POSITION_UPDATE = 1 # 0x00000001 +uint32 PHASE_UPDATE = 2 # 0x00000002 +uint32 ZERO_VELOCITY_UPDATE = 4 # 0x00000004 +uint32 WHEEL_SEONSOR_UPDATE = 8 # 0x00000008 +uint32 ALIGN_UPDATE = 16 # 0x00000010 +uint32 EXTERNAL_POSITION_UPDATE = 32 # 0x00000020 +uint32 INS_SOLUTIN_CONVERGENCE_FLAG = 64 # 0x00000040 +uint32 DOPPLER_UPDATE = 128 # 0x00000080 +uint32 PSEUDORANGE_UPDATE = 256 # 0x00000100 +uint32 VELOCITY_UPDATE = 512 # 0x00000200 +uint32 RESERVED_1 = 1024 # 0x00000400 +uint32 DEAD_RECONING_UPDATE = 2048 # 0x00000800 +uint32 PHASE_WIND_UP_UPDATE = 4096 # 0x00001000 +uint32 COURSE_OVER_GROUND_UPDATE = 8192 # 0x00002000 +uint32 EXTERNAL_VELOCITY_UPDATE = 16384 # 0x00004000 +uint32 EXTERNAL_ATTITUDE_UPDATE = 32768 # 0x00008000 +uint32 EXTERNAL_HEADING_UPDATE = 65535 # 0x00010000 +uint32 EXTERNAL_HEIGHT_UPDATE = 131072 # 0x00020000 +uint32 RESERVED_2 = 262144 # 0x00040000 +uint32 RESERVED_3 = 524288 # 0x00080000 +uint32 ROVER_POSITION_UPDATE = 1048576 # 0x00100000 +uint32 ROVER_POSITION_UPDATE_TYPE = 2097152 # 0x00200000 + +uint32 RESERVED_4 = 4194304 # 0x00400000 +uint32 RESERVED_5 = 8388608 # 0x00800000 +uint32 TURN_ON_BIASES_ESTIMATED = 16777216 # 0x01000000 +uint32 ALIGNMENT_DIRECTION_VERIFIED = 33554432 # 0x02000000 +uint32 ALIGNMENT_INDICATION_1 = 67108864 # 0x04000000 +uint32 ALIGNMENT_INDICATION_2 = 134217728 # 0x08000000 +uint32 ALIGNMENT_INDICATION_3 = 268435456 # 0x10000000 +uint32 NVM_SEED_INDICATION_1 = 538870912 # 0x20000000 +uint32 NVM_SEED_INDICATION_2 = 1073741824 # 0x40000000 +uint32 NVM_SEED_INDICATION_3 = 2147483648 # 0x80000000 + + + +# Alignment indication +uint32 ALIGNMENT_INCOMPLETE_ALIGNMENT = 0 +uint32 ALIGNMENT_STATIC = 1 +uint32 ALIGNMENT_KINETMATIC = 2 +uint32 ALIGNMENT_DUAL_ANTENNA = 3 +uint32 ALIGNMENT_USER_COMMAND = 4 +uint32 ALIGNMENT_NVM_SEED = 5 + +# NVM Seed Indication +uint32 NVM_SEED_INACTIVE = 0 +uint32 NVM_SEED_STORED_INVALID = 1 +uint32 NVM_SEED_PENDING_VALIDATION = 2 +uint32 NVM_SEED_INJECTED = 4 +uint32 NVM_SEEED_DATA_IGNORED = 5 +uint32 NVM_SEED_ERROR_MODEL_DATA_INJECTED = 6 + + + +uint32 status diff --git a/src/novatel_oem7_msgs/msg/INSFrame.msg b/src/novatel_oem7_msgs/msg/INSFrame.msg new file mode 100755 index 0000000..84bdf04 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSFrame.msg @@ -0,0 +1,4 @@ +uint32 IMUBODY = 0 +uint32 VEHICLE = 1 + +uint32 frame \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/INSOutputFrame.msg b/src/novatel_oem7_msgs/msg/INSOutputFrame.msg new file mode 100755 index 0000000..2a7fbb0 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSOutputFrame.msg @@ -0,0 +1,7 @@ + +uint32 ROVER = 1 +uint32 MASTER = 2 +uint32 ECEF = 3 +uint32 LOCALEVEL = 4 + +uint32 frame \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/INSPVA.msg b/src/novatel_oem7_msgs/msg/INSPVA.msg new file mode 100755 index 0000000..0d8a952 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSPVA.msg @@ -0,0 +1,12 @@ +std_msgs/Header header +Oem7Header nov_header +float64 latitude +float64 longitude +float64 height +float64 north_velocity +float64 east_velocity +float64 up_velocity +float64 roll +float64 pitch +float64 azimuth +InertialSolutionStatus status diff --git a/src/novatel_oem7_msgs/msg/INSPVAX.msg b/src/novatel_oem7_msgs/msg/INSPVAX.msg new file mode 100755 index 0000000..893b483 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSPVAX.msg @@ -0,0 +1,25 @@ +std_msgs/Header header +Oem7Header nov_header +InertialSolutionStatus ins_status +PositionOrVelocityType pos_type +float64 latitude +float64 longitude +float64 height +float32 undulation +float64 north_velocity +float64 east_velocity +float64 up_velocity +float64 roll +float64 pitch +float64 azimuth +float32 latitude_stdev +float32 longitude_stdev +float32 height_stdev +float32 north_velocity_stdev +float32 east_velocity_stdev +float32 up_velocity_stdev +float32 roll_stdev +float32 pitch_stdev +float32 azimuth_stdev +INSExtendedSolutionStatus ext_sol_status +uint16 time_since_update diff --git a/src/novatel_oem7_msgs/msg/INSReceiverStatus.msg b/src/novatel_oem7_msgs/msg/INSReceiverStatus.msg new file mode 100755 index 0000000..d7144fa --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSReceiverStatus.msg @@ -0,0 +1,10 @@ + +uint8 INS_RESET_BYTE = 0 +# Refer to INSResetType for values + + +uint8 BYTE_1 = 1 +uint8 IMU_COMMUNICATION_ERROR = 1 + +# Bytes 3-4 are reserved +uint8[4] status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/INSResetType.msg b/src/novatel_oem7_msgs/msg/INSResetType.msg new file mode 100755 index 0000000..42ba216 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSResetType.msg @@ -0,0 +1,21 @@ +uint8 INITIALIZED = 0 +uint8 INS_TIMING_ERROR = 1 +uint8 INVALID_SOLUTION = 2 +uint8 INS_ORIENT_CHANGED = 3 +uint8 INS_USER_COMMAND = 4 +uint8 INS_CALIBRATION = 5 +uint8 INIT_ATTITUDE_RECEIVED = 6 +uint8 ALIGNMENT_MODE_CHANGED = 8 +uint8 EXPT_RESTRICTS_EXCEEDED = 9 +uint8 DATA_GAP = 10 +uint8 RECEIVED_IMU_SPECS = 11 +uint8 ACCEL_RESTRICTIONS_EXCEEDED = 12 +uint8 ROTATION_RESTRICTIONS_EXCEEDED = 13 +uint8 RAWIMU_STATUS_INVALID = 14 +uint8 IMU_CONFIGURED = 15 +uint8 IMU_UNUSPPORTED = 16 +uint8 INS_SEED_INVALID = 17 +uint8 INS_SEED_VALIDATION_FAILED = 18 +uint8 USER_COMMAND_RESTART = 19 + +uint8 type \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/INSSTDEV.msg b/src/novatel_oem7_msgs/msg/INSSTDEV.msg new file mode 100755 index 0000000..95a91f1 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSSTDEV.msg @@ -0,0 +1,16 @@ +std_msgs/Header header +Oem7Header nov_header +float32 latitude_stdev +float32 longitude_stdev +float32 height_stdev +float32 north_velocity_stdev +float32 east_velocity_stdev +float32 up_velocity_stdev +float32 roll_stdev +float32 pitch_stdev +float32 azimuth_stdev +INSExtendedSolutionStatus ext_sol_status +uint16 time_since_last_update +uint16 reserved1 +uint32 reserved2 +uint32 reserved3 diff --git a/src/novatel_oem7_msgs/msg/INSSourceStatus.msg b/src/novatel_oem7_msgs/msg/INSSourceStatus.msg new file mode 100755 index 0000000..b38c734 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSSourceStatus.msg @@ -0,0 +1,11 @@ +uint32 FROM_NVM = 1 +uint32 CALIBRATING = 2 +uint32 CALIBRATED = 3 +uint32 FROM_COMMAND = 4 +uint32 RESET = 5 +uint32 FROM_DUAL_ANT = 6 +uint32 INS_CONVERSING = 7 +uint32 INSUFFICIENT_SPEED = 8 +uint32 HIGH_ROTATION = 9 + +uint32 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/INSUpdate.msg b/src/novatel_oem7_msgs/msg/INSUpdate.msg new file mode 100755 index 0000000..a1e78ea --- /dev/null +++ b/src/novatel_oem7_msgs/msg/INSUpdate.msg @@ -0,0 +1,4 @@ + + + +uint8[4] update \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/InertialSolutionStatus.msg b/src/novatel_oem7_msgs/msg/InertialSolutionStatus.msg new file mode 100755 index 0000000..0082f05 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/InertialSolutionStatus.msg @@ -0,0 +1,14 @@ + +uint32 INS_INACTIVE = 0 +uint32 INS_ALIGNING = 1 +uint32 INS_HIGH_VARIANCE = 2 +uint32 INS_SOLUTION_GOOD = 3 +uint32 INS_SOLUTION_FREE = 6 +uint32 INS_ALIGNMENT_COMPLETE = 7 +uint32 DETERMINING_ORIENTATION = 8 +uint32 WAITING_INITIAL_POS = 9 +uint32 WAITING_AZIMUTH = 10 +uint32 INITIALIZING_BIASES = 11 +uint32 MOTION_DETECT = 12 + +uint32 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/LocalAreaStatus.msg b/src/novatel_oem7_msgs/msg/LocalAreaStatus.msg new file mode 100755 index 0000000..88fc3de --- /dev/null +++ b/src/novatel_oem7_msgs/msg/LocalAreaStatus.msg @@ -0,0 +1,9 @@ +uint32 DISABLED = 0 +uint32 WAITING_FOR_POSITION = 1 +uint32 RANGE_CHECK = 16 +uint32 IN_RANGE = 129 +uint32 OUT_OF_RANGE = 130 +uint32 POSITION_TOO_OLD = 255 + + +uint32 status \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/Oem7Header.msg b/src/novatel_oem7_msgs/msg/Oem7Header.msg new file mode 100755 index 0000000..24b76fa --- /dev/null +++ b/src/novatel_oem7_msgs/msg/Oem7Header.msg @@ -0,0 +1,13 @@ +uint16 OEM7MSGTYPE_LOG = 0 + + +string message_name +uint16 message_id +uint8 message_type +uint32 sequence_number +uint8 time_status +uint16 gps_week_number +uint32 gps_week_milliseconds +uint32 receiver_status +float32 idle_time + diff --git a/src/novatel_oem7_msgs/msg/Oem7RawMsg.msg b/src/novatel_oem7_msgs/msg/Oem7RawMsg.msg new file mode 100755 index 0000000..e0a0e3c --- /dev/null +++ b/src/novatel_oem7_msgs/msg/Oem7RawMsg.msg @@ -0,0 +1,3 @@ +std_msgs/Header header +uint8[] message_data + diff --git a/src/novatel_oem7_msgs/msg/PPPPOS.msg b/src/novatel_oem7_msgs/msg/PPPPOS.msg new file mode 100755 index 0000000..75f1c62 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/PPPPOS.msg @@ -0,0 +1,29 @@ +std_msgs/Header header +Oem7Header nov_header +SolutionStatus sol_status +PositionOrVelocityType pos_type +float64 lat +float64 lon +float64 hgt +float32 undulation +uint32 datum_id +float32 lat_stdev +float32 lon_stdev +float32 hgt_stdev +string stn_id +float32 diff_age +float32 sol_age +uint8 num_svs +uint8 num_sol_svs +uint8 num_sol_l1_svs +uint8 num_sol_multi_svs +uint8 reserved +BestExtendedSolutionStatus ext_sol_stat +uint8 reserved2 +uint8 gps_glonass_sig_mask + + + + + + diff --git a/src/novatel_oem7_msgs/msg/PositionOrVelocityType.msg b/src/novatel_oem7_msgs/msg/PositionOrVelocityType.msg new file mode 100755 index 0000000..897ad39 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/PositionOrVelocityType.msg @@ -0,0 +1,33 @@ +uint32 NONE = 0 +uint32 FIXEDPOS = 1 +uint32 FIXEDHEIGHT = 2 +uint32 DOPPLER_VELOCITY = 8 +uint32 SINGLE = 16 +uint32 PSRDIFF = 17 +uint32 WAAS = 18 +uint32 PROPAGATED = 19 +uint32 L1_FLOAT = 32 +uint32 NARROW_FLOAT = 34 +uint32 L1_INT = 48 +uint32 WIDE_INT = 49 +uint32 NARROW_INT = 50 +uint32 RTK_DIRECT_INS = 51 +uint32 INS_SBAS = 52 +uint32 INS_PSRSP = 53 +uint32 INS_PSRDIFF = 54 +uint32 INS_RTKFLOAT = 55 +uint32 INS_RTKFIXED = 56 +uint32 PPP_CONVERGING = 68 +uint32 PPP = 69 +uint32 OPERATIONAL = 70 +uint32 WARNING = 71 +uint32 OUT_OF_BOUNDS = 72 +uint32 INS_PPP_CONVERGING = 73 +uint32 INS_PPP = 74 +uint32 PPP_BASIC_CONVERGING = 77 +uint32 PPP_BASIC = 78 +uint32 INS_PPP_BASIC_CONVERGING = 79 +uint32 INS_PPP_BASIC = 80 + + +uint32 type \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/RAWIMUSX.msg b/src/novatel_oem7_msgs/msg/RAWIMUSX.msg new file mode 100755 index 0000000..8701150 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/RAWIMUSX.msg @@ -0,0 +1,13 @@ +std_msgs/Header header +Oem7Header nov_header +uint8 imu_info +uint8 imu_type +uint16 gnss_week +float64 gnss_week_seconds +uint8[4] imu_status +int32 z_acc +int32 y_acc +int32 x_acc +int32 z_gyro +int32 y_gyro +int32 x_gyro \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/RXSTATUS.msg b/src/novatel_oem7_msgs/msg/RXSTATUS.msg new file mode 100755 index 0000000..61c4b89 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/RXSTATUS.msg @@ -0,0 +1,36 @@ +std_msgs/Header header +Oem7Header nov_header +uint32 error +uint32 num_status_codes +uint32 rxstat +uint32 rxstat_pri_mask +uint32 rxstat_set_mask +uint32 rxstat_clr_mask +uint32 aux1_stat +uint32 aux1_stat_pri +uint32 aux1_stat_set +uint32 aux1_stat_clr +uint32 aux2_stat +uint32 aux2_stat_pri +uint32 aux2_stat_set +uint32 aux2_stat_clr +uint32 aux3_stat +uint32 aux3_stat_pri +uint32 aux3_stat_set +uint32 aux3_stat_clr +uint32 aux4_stat +uint32 aux4_stat_pri +uint32 aux4_stat_set +uint32 aux4_stat_clr +uint8[<=32] error_bits +string<=256[<=32] error_strs +uint8[<=32] rxstat_bits +string<=256[<=32] rxstat_strs +uint8[<=32] aux1_stat_bits +string<=256[<=32] aux1_stat_strs +uint8[<=32] aux2_stat_bits +string<=256[<=32] aux2_stat_strs +uint8[<=32] aux3_stat_bits +string<=256[<=32] aux3_stat_strs +uint8[<=32] aux4_stat_bits +string<=256[<=32] aux4_stat_strs diff --git a/src/novatel_oem7_msgs/msg/RegionRestriction.msg b/src/novatel_oem7_msgs/msg/RegionRestriction.msg new file mode 100755 index 0000000..e8abd01 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/RegionRestriction.msg @@ -0,0 +1,6 @@ +uint32 NONE = 0 +uint32 GEOGATED = 1 +uint32 LOCAL_AREA = 2 +uint32 NEARSHORE = 3 + +uint32 restriction \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/Rotation.msg b/src/novatel_oem7_msgs/msg/Rotation.msg new file mode 100755 index 0000000..bae5230 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/Rotation.msg @@ -0,0 +1,9 @@ +RotationalOffset rotation +INSFrame frame +float32 x_rotation +float32 y_rotation +float32 z_rotation +float32 x_rotation_stdev +float32 y_rotation_stdev +float32 z_rotation_stdev +INSSourceStatus rotation_source \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/RotationalOffset.msg b/src/novatel_oem7_msgs/msg/RotationalOffset.msg new file mode 100755 index 0000000..3307a14 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/RotationalOffset.msg @@ -0,0 +1,10 @@ +uint32 USER = 4 +uint32 MARK1 = 5 +uint32 MARK2 = 6 +uint32 ALIGN = 8 +uint32 MARK3 = 9 +uint32 MARK4 = 10 +uint32 RBV = 11 +uint32 RBM = 12 + +uint32 offset \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/SolutionSource.msg b/src/novatel_oem7_msgs/msg/SolutionSource.msg new file mode 100755 index 0000000..f3777d8 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/SolutionSource.msg @@ -0,0 +1,9 @@ +uint8 RESERVED1 = 3 # 0x3 + +uint8 SOURCE_ANTENNA_MASK = 12 # 0xC +uint8 PRIMARY_ANTENNA = 0 +uint8 SECONDARY_ANTENNA = 0 + +uint8 RESERVED2 = 240 # 0xF0 + +uint8 source \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/SolutionStatus.msg b/src/novatel_oem7_msgs/msg/SolutionStatus.msg new file mode 100755 index 0000000..b763e73 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/SolutionStatus.msg @@ -0,0 +1,17 @@ +uint32 SOL_COMPUTED = 0 +uint32 INSUFFICIENT_OBS = 1 +uint32 NO_CONVERGENCE = 2 +uint32 SINGULARITY = 3 +uint32 COV_TRACE = 4 +uint32 TEST_DIST = 5 +uint32 COLD_START = 6 +uint32 V_H_LIMIT = 7 +uint32 VARIANCE = 8 +uint32 RESIDUALS = 9 +uint32 INTEGRITY_WARNING = 13 +uint32 PENDING = 18 +uint32 INVALID_FIX = 19 +uint32 UNAUTHORIZED = 20 +uint32 INVALID_RATE = 22 + +uint32 status diff --git a/src/novatel_oem7_msgs/msg/SubscriptionPermission.msg b/src/novatel_oem7_msgs/msg/SubscriptionPermission.msg new file mode 100755 index 0000000..a3f9574 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/SubscriptionPermission.msg @@ -0,0 +1,11 @@ +uint32 RESERVED_1 = 511 # 0x000001FF +uint32 TERRASTAR_C_SERVICE = 512 # 0x00000200 +uint32 TERRASTAR_L_SERVICE = 1024 # 0x00000400 +uint32 RTK_ASSIST_SERVICE = 2048 # 0x00000800 +uint32 RTK_ASSIST_PRO_SERVICE = 4096 # 0x00001000 +uint32 TERRASTAR_C_PRO_SERVICE = 8192 # 0x00002000 +uint32 TERRASTAR_X_SERVICE = 16384 # 0x00004000 +uint32 RESERVED_2 = 2147450880 # 0x7FFF8000 + + +uint32 permission \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/SubscriptionType.msg b/src/novatel_oem7_msgs/msg/SubscriptionType.msg new file mode 100755 index 0000000..b80ad0d --- /dev/null +++ b/src/novatel_oem7_msgs/msg/SubscriptionType.msg @@ -0,0 +1,8 @@ +uint32 UNASSIGNED = 0 +uint32 TERM = 1 +uint32 MODEL = 5 +uint32 BUBBLE = 100 +uint32 INCOMPATIBLE_SUBSCRIPTION = 104 + + +uint32 type \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/SyncState.msg b/src/novatel_oem7_msgs/msg/SyncState.msg new file mode 100755 index 0000000..3b8ba58 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/SyncState.msg @@ -0,0 +1,6 @@ +uint32 NO_SIGNAL = 0 +uint32 SEARCH = 1 +uint32 LOCKED = 2 + + +uint32 state \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/TERRASTARINFO.msg b/src/novatel_oem7_msgs/msg/TERRASTARINFO.msg new file mode 100755 index 0000000..d723594 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/TERRASTARINFO.msg @@ -0,0 +1,19 @@ +std_msgs/Header header +Oem7Header nov_header +string product_activation_code +SubscriptionType sub_type +SubscriptionPermission sub_permission +uint32 service_end_day_of_year +uint32 service_end_year +uint32 reserved +RegionRestriction region_restriction +float32 center_point_latitude +float32 center_point_longitude +uint32 radius + + + + + + + diff --git a/src/novatel_oem7_msgs/msg/TERRASTARSTATUS.msg b/src/novatel_oem7_msgs/msg/TERRASTARSTATUS.msg new file mode 100755 index 0000000..bf0e067 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/TERRASTARSTATUS.msg @@ -0,0 +1,13 @@ +std_msgs/Header header +Oem7Header nov_header +AccessStatus access_status +SyncState sync_state +uint32 reserved +LocalAreaStatus local_area_status +GeogatingStatus geo_status + + + + + + diff --git a/src/novatel_oem7_msgs/msg/TIME.msg b/src/novatel_oem7_msgs/msg/TIME.msg new file mode 100755 index 0000000..439dd43 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/TIME.msg @@ -0,0 +1,16 @@ +std_msgs/Header header +Oem7Header nov_header +uint32 clock_status +float64 offset +float64 offset_std +float64 utc_offset +uint32 utc_year +uint8 utc_month +uint8 utc_day +uint8 utc_hour +uint8 utc_min +uint32 utc_msec +uint32 utc_status + + + diff --git a/src/novatel_oem7_msgs/msg/Translation.msg b/src/novatel_oem7_msgs/msg/Translation.msg new file mode 100755 index 0000000..9cb3773 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/Translation.msg @@ -0,0 +1,9 @@ +TranslationOffset translation +INSFrame frame +float32 x_offset +float32 y_offset +float32 z_offset +float32 x_uncertainty +float32 y_uncertainty +float32 z_uncertainty +INSSourceStatus translation_source \ No newline at end of file diff --git a/src/novatel_oem7_msgs/msg/TranslationOffset.msg b/src/novatel_oem7_msgs/msg/TranslationOffset.msg new file mode 100755 index 0000000..7979b15 --- /dev/null +++ b/src/novatel_oem7_msgs/msg/TranslationOffset.msg @@ -0,0 +1,11 @@ +uint32 ANT1 = 1 +uint32 ANT2 = 2 +uint32 EXTERNAL = 3 +uint32 USER = 4 +uint32 MARK1 = 5 +uint32 MARK2 = 6 +uint32 GIMBAL = 7 +uint32 MARK3 = 9 +uint32 MARK4 = 10 + +uint32 type diff --git a/src/novatel_oem7_msgs/package.xml b/src/novatel_oem7_msgs/package.xml new file mode 100755 index 0000000..46b8e66 --- /dev/null +++ b/src/novatel_oem7_msgs/package.xml @@ -0,0 +1,27 @@ + + + novatel_oem7_msgs + 20.8.0 + + Messages for NovAtel Oem7 family of receivers. + + + NovAtel Support + http://www.novatel.com + MIT + + https://github.com/novatel/novatel_oem7_driver + + ament_cmake + rosidl_default_generators + std_msgs + + rosidl_default_runtime + + + ament_cmake + + + rosidl_interface_packages + + diff --git a/src/novatel_oem7_msgs/srv/Oem7AbasciiCmd.srv b/src/novatel_oem7_msgs/srv/Oem7AbasciiCmd.srv new file mode 100755 index 0000000..19be656 --- /dev/null +++ b/src/novatel_oem7_msgs/srv/Oem7AbasciiCmd.srv @@ -0,0 +1,4 @@ +string cmd +--- +string rsp + diff --git a/src/vehicle_pkg/config/fr09-carla/hero.json b/src/vehicle_pkg/config/fr09-carla/hero.json new file mode 100755 index 0000000..9190157 --- /dev/null +++ b/src/vehicle_pkg/config/fr09-carla/hero.json @@ -0,0 +1,63 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.opendrive_map", + "id": "map" + }, + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.fr-09", + "id": "hero", + "spawn_point": { + "x": 8.0, + "y": 0.0, + "z": 0.5, + "roll": 0.0, + "pitch": 0.0, + "yaw": 270.0 + }, + "sensors": [ + { + "type": "sensor.camera.rgb", + "id": "rgb_view", + "spawn_point": { + "x": -4.5, + "y": 0.0, + "z": 2.8, + "roll": 0.0, + "pitch": 20.0, + "yaw": 0.0 + }, + "image_size_x": 800, + "image_size_y": 600, + "fov": 90.0, + "attached_objects": [ + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + }, + { + "type": "sensor.pseudo.tf", + "id": "tf" + }, + { + "type": "sensor.pseudo.odom", + "id": "odometry" + }, + { + "type": "sensor.pseudo.speedometer", + "id": "speedometer" + }, + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/fr09-carla/imu.json b/src/vehicle_pkg/config/fr09-carla/imu.json new file mode 100755 index 0000000..5b217b2 --- /dev/null +++ b/src/vehicle_pkg/config/fr09-carla/imu.json @@ -0,0 +1,35 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.fr-09", + "id": "hero", + "sensors": [ + { + "type": "sensor.other.imu", + "id": "imu", + "spawn_point": { + "x": 0.0, + "y": 0.0, + "z": 0.5, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "noise_accel_stddev_x": 0.0, + "noise_accel_stddev_y": 0.0, + "noise_accel_stddev_z": 0.0, + "noise_gyro_stddev_x": 0.0, + "noise_gyro_stddev_y": 0.0, + "noise_gyro_stddev_z": 0.0, + "noise_gyro_bias_x": 0.0, + "noise_gyro_bias_y": 0.0, + "noise_gyro_bias_z": 0.0 + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/fr09-carla/ouster_lidar.json b/src/vehicle_pkg/config/fr09-carla/ouster_lidar.json new file mode 100755 index 0000000..490ddd4 --- /dev/null +++ b/src/vehicle_pkg/config/fr09-carla/ouster_lidar.json @@ -0,0 +1,33 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.fr-09", + "id": "hero", + "sensors": [ + { + "type": "sensor.lidar.ray_cast", + "id": "lidar", + "spawn_point": { + "x": 0.456, + "y": 0.0, + "z": 1.135, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "range": 90, + "channels": 32, + "points_per_second": 655360, + "upper_fov": 21.2, + "lower_fov": -21.2, + "rotation_frequency": 20, + "noise_stddev": 0.0 + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/fr09-carla/vanjee_lidar.json b/src/vehicle_pkg/config/fr09-carla/vanjee_lidar.json new file mode 100755 index 0000000..a3b6454 --- /dev/null +++ b/src/vehicle_pkg/config/fr09-carla/vanjee_lidar.json @@ -0,0 +1,33 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.fr-09", + "id": "hero", + "sensors": [ + { + "type": "sensor.lidar.ray_cast", + "id": "lidar", + "spawn_point": { + "x": 0.456, + "y": 0.0, + "z": 1.135, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "range": 150, + "channels": 32, + "points_per_second": 576000, + "upper_fov": 15.0, + "lower_fov": -16.0, + "rotation_frequency": 20, + "noise_stddev": 0.0 + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/mkmini-carla/hero.json b/src/vehicle_pkg/config/mkmini-carla/hero.json new file mode 100755 index 0000000..a989958 --- /dev/null +++ b/src/vehicle_pkg/config/mkmini-carla/hero.json @@ -0,0 +1,63 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.opendrive_map", + "id": "map" + }, + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.mkmini3", + "id": "hero", + "spawn_point": { + "x": 8.0, + "y": 0.0, + "z": 0.5, + "roll": 0.0, + "pitch": 0.0, + "yaw": 270.0 + }, + "sensors": [ + { + "type": "sensor.camera.rgb", + "id": "rgb_view", + "spawn_point": { + "x": -4.5, + "y": 0.0, + "z": 2.8, + "roll": 0.0, + "pitch": 20.0, + "yaw": 0.0 + }, + "image_size_x": 800, + "image_size_y": 600, + "fov": 90.0, + "attached_objects": [ + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + }, + { + "type": "sensor.pseudo.tf", + "id": "tf" + }, + { + "type": "sensor.pseudo.odom", + "id": "odometry" + }, + { + "type": "sensor.pseudo.speedometer", + "id": "speedometer" + }, + { + "type": "actor.pseudo.control", + "id": "control" + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/mkmini-carla/imu.json b/src/vehicle_pkg/config/mkmini-carla/imu.json new file mode 100755 index 0000000..676172e --- /dev/null +++ b/src/vehicle_pkg/config/mkmini-carla/imu.json @@ -0,0 +1,35 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.mkmini3", + "id": "hero", + "sensors": [ + { + "type": "sensor.other.imu", + "id": "imu", + "spawn_point": { + "x": 0.1, + "y": 0.0, + "z": 0.6, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "noise_accel_stddev_x": 0.0, + "noise_accel_stddev_y": 0.0, + "noise_accel_stddev_z": 0.0, + "noise_gyro_stddev_x": 0.0, + "noise_gyro_stddev_y": 0.0, + "noise_gyro_stddev_z": 0.0, + "noise_gyro_bias_x": 0.0, + "noise_gyro_bias_y": 0.0, + "noise_gyro_bias_z": 0.0 + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/mkmini-carla/ouster_lidar.json b/src/vehicle_pkg/config/mkmini-carla/ouster_lidar.json new file mode 100755 index 0000000..8a2630e --- /dev/null +++ b/src/vehicle_pkg/config/mkmini-carla/ouster_lidar.json @@ -0,0 +1,33 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.mkmini3", + "id": "hero", + "sensors": [ + { + "type": "sensor.lidar.ray_cast", + "id": "lidar", + "spawn_point": { + "x": 0.456, + "y": 0.0, + "z": 1.135, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "range": 90, + "channels": 32, + "points_per_second": 655360, + "upper_fov": 21.2, + "lower_fov": -21.2, + "rotation_frequency": 20, + "noise_stddev": 0.0 + } + ] + } + ] +} diff --git a/src/vehicle_pkg/config/mkmini-carla/vanjee_lidar.json b/src/vehicle_pkg/config/mkmini-carla/vanjee_lidar.json new file mode 100755 index 0000000..d3d487d --- /dev/null +++ b/src/vehicle_pkg/config/mkmini-carla/vanjee_lidar.json @@ -0,0 +1,34 @@ +{ + "objects": [ + { + "type": "sensor.pseudo.actor_list", + "id": "actor_list" + }, + { + "type": "vehicle.custom.mkmini3", + "id": "hero", + "sensors": [ + { + "type": "sensor.lidar.ray_cast", + "id": "lidar", + "spawn_point": { + "x": 0.1, + "y": 0.0, + "z": 0.6, + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0 + }, + "range": 90, + "channels": 32, + "points_per_second": 655360, + "upper_fov": 21.2, + "lower_fov": -21.2, + "rotation_frequency": 20, + "noise_stddev": 0.0 + } + ] + } + ] +} + diff --git a/src/vehicle_pkg/config/platforms/platform_f1tenth.yaml b/src/vehicle_pkg/config/platforms/platform_f1tenth.yaml new file mode 100755 index 0000000..11f68d3 --- /dev/null +++ b/src/vehicle_pkg/config/platforms/platform_f1tenth.yaml @@ -0,0 +1,28 @@ +# Platform profile — F1TENTH (실차, VESC + Hokuyo) +# +# 물리값은 사용자 실측(2026-06-19). 스톡 f1tenth_system vesc.yaml 의 wheelbase 0.25 는 +# 사용하지 않음 — 실측 0.32 가 source of truth. +# max_steering_angle 은 VESC 서보 설정에서 역산(보수적, 실차 튜닝). 회전반경 = wheelbase/tan(angle) ≈ 0.97m. +# +# Phase 2 — F1TENTH 실차 (Jetson aarch64). sim 미지원. +platform: + name: f1tenth + display_name: F1tenth # DB Platform.name 과 byte-일치 (등록 매니페스트) + modes: [real] # sim 프로필 없음 — F1TENTH 는 실차만 검증 + drive_type: ackermann + + wheelbase: 0.32 # m (실측: 끝-끝 0.43 − 바퀴 0.11) + max_steering_angle: 0.32 # rad (VESC 서보 역산, 보수적) + max_speed: 1.0 # m/s (안전 속도캡 시작값) + track_width: 0.24 # m (실측 바깥-바깥 0.294 − 타이어폭; 참고용, ackermann 미사용) + wheel_radius: 0.055 # m (실측 지름 0.11 / 2; odom 은 speed_to_erpm_gain 내장값 사용 — 중복 X) + + default_vehicle_driver: vesc # 실차 (VESC + ackermann_mux) + default_sensor_driver: hokuyo # 실차 (urg_node, LaserScan native) + sim_vehicle_driver: # 없음 — F1TENTH 는 실차만 검증 + sim_sensor_driver: # 없음 + + perception_profile: f1tenth + scan_topic: /scan + odom_topic: /odom_custom + lidar_frame: os_lidar # frame 재사용 (slam/costmap frame 가정 보존) diff --git a/src/vehicle_pkg/config/platforms/platform_fr09.yaml b/src/vehicle_pkg/config/platforms/platform_fr09.yaml new file mode 100755 index 0000000..af1a9bf --- /dev/null +++ b/src/vehicle_pkg/config/platforms/platform_fr09.yaml @@ -0,0 +1,26 @@ +# Platform profile — FR-09 +# +# 값은 기존 vehicle_fr09.yaml / sensor_bridge_{fr09,carla}.yaml 에서 그대로 이전. +# Phase 1 Step 4: data-driven launch 진입점. +platform: + name: fr09 + display_name: FR09 + modes: [sim, real] + drive_type: ackermann + + wheelbase: 0.856 # m (= 기존 vehicle_fr09.yaml) + max_steering_angle: 0.463 # rad + max_speed: 0.6 # m/s (sim 상한) + track_width: # m — 미측정 (현재 odom/TF 미사용) + wheel_radius: # m — 미측정 + + default_vehicle_driver: fr09_tod # 실차 (yhs 같은 hw include 없음 — 과거 Autoware-fed) + default_sensor_driver: fr09_autoware + sim_vehicle_driver: carla_ackermann + sim_sensor_driver: carla_lidar + sim_lidar: ouster # CARLA 스폰 blueprint 정체성 (차량↔라이다 고정 페어링) + + perception_profile: fr09 + scan_topic: /scan + odom_topic: /odom_custom + lidar_frame: os_lidar diff --git a/src/vehicle_pkg/config/platforms/platform_mkmini.yaml b/src/vehicle_pkg/config/platforms/platform_mkmini.yaml new file mode 100755 index 0000000..5a65343 --- /dev/null +++ b/src/vehicle_pkg/config/platforms/platform_mkmini.yaml @@ -0,0 +1,33 @@ +# Platform profile — MK-Mini +# +# 진입점 프로파일: 물리 제원 + 기본/시뮬 드라이버 *선언*. (요구 4·5) +# 값은 기존 vehicle_mkmini.yaml / sensor_bridge_{mkmini,carla}.yaml 에서 그대로 이전 +# (신규 하드코딩 도입 없음). +# +# Phase 1 Step 2: dormant — 아직 vehicle.launch.py 가 읽지 않음. +# Step 4 에서 launch 인터프리터가 이 파일을 읽어 driver/adapter 를 동적 spawn. +platform: + name: mkmini + display_name: MK-mini # DB Platform.name 과 byte-일치 + modes: [sim, real] + drive_type: ackermann # ackermann | differential + + # 물리 제원 + wheelbase: 0.6 # m (= 기존 vehicle_mkmini.yaml cmd_vel_to_*.wheelbase) + max_steering_angle: 0.5 # rad + max_speed: 0.6 # m/s (sim 상한; 실차 안전상한은 vehicle_driver 프로파일) + track_width: # m — 미측정 (현재 odom/TF 미사용). 측정 후 기입 + wheel_radius: # m — 미측정 (현재 미사용) + + # 드라이버 선택 (선택 source = 이 데이터. registry.py 는 이름→노드만) + default_vehicle_driver: yhs_can # 실차 (sim_mode=false) + default_sensor_driver: vanjee # 실차 (sim_mode=false) + sim_vehicle_driver: carla_ackermann # sim_mode=true + sim_sensor_driver: carla_lidar # sim_mode=true + sim_lidar: vanjee # CARLA 스폰 blueprint 정체성 (차량↔라이다 고정 페어링) + + # cross-workspace 규칙 키 (기존 {robot} 컨벤션 보존 — 다운스트림 무수정) + perception_profile: mkmini # → perception_{...}.yaml, tf_{...}.yaml, control_*_{...}.yaml + scan_topic: /scan + odom_topic: /odom_custom + lidar_frame: os_lidar diff --git a/src/vehicle_pkg/config/platforms/platform_turtlebot3.yaml b/src/vehicle_pkg/config/platforms/platform_turtlebot3.yaml new file mode 100644 index 0000000..b13bd8b --- /dev/null +++ b/src/vehicle_pkg/config/platforms/platform_turtlebot3.yaml @@ -0,0 +1,24 @@ +# TurtleBot3 Burger profile for the Gazebo learning environment. +# Gazebo owns the robot, LiDAR, odometry, TF, and /cmd_vel subscription. +platform: + name: turtlebot3 + display_name: TurtleBot3 Burger + modes: [sim] + simulator: gazebo + drive_type: differential + + wheelbase: 0.16 + max_steering_angle: 0.0 + max_speed: 0.22 + track_width: 0.16 + wheel_radius: 0.033 + + default_vehicle_driver: gazebo_passthrough + default_sensor_driver: gazebo_laserscan + sim_vehicle_driver: gazebo_passthrough + sim_sensor_driver: gazebo_laserscan + + perception_profile: turtlebot3 + scan_topic: /scan + odom_topic: /odom + lidar_frame: base_scan diff --git a/src/vehicle_pkg/config/sensor_bridge_carla.yaml b/src/vehicle_pkg/config/sensor_bridge_carla.yaml new file mode 100755 index 0000000..862f129 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_bridge_carla.yaml @@ -0,0 +1,13 @@ + +sensor_bridge: + ros__parameters: + input_lidar_topic: "/carla/hero/lidar" + output_lidar_topic: "/raw/lidar" + lidar_frame: "os_lidar" + + input_imu_topic: "/carla/hero/imu" + output_imu_topic: "/raw/imu" + imu_frame: "os_imu" + + input_speed_topic: "/carla/hero/speedometer" + output_speed_topic: "/raw/speed" diff --git a/src/vehicle_pkg/config/sensor_bridge_fr09.yaml b/src/vehicle_pkg/config/sensor_bridge_fr09.yaml new file mode 100755 index 0000000..33d9cb1 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_bridge_fr09.yaml @@ -0,0 +1,14 @@ + +sensor_bridge: + ros__parameters: + input_lidar_topic: "/sensing/lidar/top/pointcloud" + output_lidar_topic: "/raw/lidar" + lidar_frame: "os_lidar" + + input_imu_topic: "/sensing/imu/imu_data" + output_imu_topic: "/raw/imu" + imu_frame: "os_imu" + + input_speed_topic: "/vehicle/status/velocity_status" + output_speed_topic: "/raw/speed" + diff --git a/src/vehicle_pkg/config/sensor_bridge_mkmini.yaml b/src/vehicle_pkg/config/sensor_bridge_mkmini.yaml new file mode 100755 index 0000000..0fca155 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_bridge_mkmini.yaml @@ -0,0 +1,13 @@ + +sensor_bridge: + ros__parameters: + input_lidar_topic: "/vanjee_points720_32" + output_lidar_topic: "/raw/lidar" + lidar_frame: "os_lidar" + + input_imu_topic: "/vanjee_lidar_imu_packets" + output_imu_topic: "/raw/imu" + imu_frame: "os_imu" + + input_speed_topic: "/chassis_info_fb" + output_speed_topic: "/raw/speed" diff --git a/src/vehicle_pkg/config/sensor_drivers/sensor_driver_carla_lidar.yaml b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_carla_lidar.yaml new file mode 100755 index 0000000..0515a72 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_carla_lidar.yaml @@ -0,0 +1,30 @@ +# Sensor driver profile — CARLA LiDAR (sim) +# +# bridge 값은 기존 sensor_bridge_carla.yaml 에서 그대로 이전. +# +# Phase 1 Step 2: dormant. +sensor_driver: + name: carla_lidar + display_name: CARLA LiDAR (sim) + dimension: 3d + modes: [sim] # sim 전용 — Real 모드 센서 선택지에서 제외 + compatible_platforms: [fr09, mkmini] + scan_adapter: pointcloud_to_laserscan + + # sim — 하드웨어 driver 없음 + driver_launch: + package: "" + launch: "" + + speed_msg: sim_float32 # /carla/hero/speedometer (Float32) + + # = 기존 sensor_bridge_carla.yaml sensor_bridge.ros__parameters + bridge: + input_lidar_topic: /carla/hero/lidar + output_lidar_topic: /raw/lidar + lidar_frame: os_lidar + input_imu_topic: /carla/hero/imu + output_imu_topic: /raw/imu + imu_frame: os_imu + input_speed_topic: /carla/hero/speedometer + output_speed_topic: /raw/speed diff --git a/src/vehicle_pkg/config/sensor_drivers/sensor_driver_fr09_autoware.yaml b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_fr09_autoware.yaml new file mode 100755 index 0000000..d814fe6 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_fr09_autoware.yaml @@ -0,0 +1,30 @@ +# Sensor driver profile — FR-09 (실차, Autoware 토픽 규약) +# +# bridge 값은 기존 sensor_bridge_fr09.yaml 에서 그대로 이전. +# 속도 입력은 없음(speed_msg: none) — 기존 sensor_bridge.py 도 fr09 실차 속도 미구독. +# +# Phase 1 Step 4. +sensor_driver: + name: fr09_autoware + display_name: Ouster OS1 (Autoware feed) + dimension: 3d + lidar_id: os0-128 # 런처 SLAM 라이다 선택 자동잠금용 (lidar_models.json id) + compatible_platforms: [fr09] + scan_adapter: pointcloud_to_laserscan + + driver_launch: # 하드웨어 driver 없음 (과거 Autoware-fed) + package: "" + launch: "" + + speed_msg: none + + # = 기존 sensor_bridge_fr09.yaml sensor_bridge.ros__parameters + bridge: + input_lidar_topic: /sensing/lidar/top/pointcloud + output_lidar_topic: /raw/lidar + lidar_frame: os_lidar + input_imu_topic: /sensing/imu/imu_data + output_imu_topic: /raw/imu + imu_frame: os_imu + input_speed_topic: /vehicle/status/velocity_status + output_speed_topic: /raw/speed diff --git a/src/vehicle_pkg/config/sensor_drivers/sensor_driver_gazebo_laserscan.yaml b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_gazebo_laserscan.yaml new file mode 100644 index 0000000..b8b4dc9 --- /dev/null +++ b/src/vehicle_pkg/config/sensor_drivers/sensor_driver_gazebo_laserscan.yaml @@ -0,0 +1,13 @@ +# Gazebo TurtleBot3 already publishes sensor_msgs/LaserScan on /scan. +sensor_driver: + name: gazebo_laserscan + display_name: Gazebo LaserScan + dimension: 2d + modes: [sim] + compatible_platforms: [turtlebot3] + scan_adapter: laserscan_passthrough + driver_launch: + package: "" + launch: "" + speed_msg: none + bridge: {} diff --git a/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_carla_ackermann.yaml b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_carla_ackermann.yaml new file mode 100755 index 0000000..d9bfb95 --- /dev/null +++ b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_carla_ackermann.yaml @@ -0,0 +1,26 @@ +# Vehicle driver profile — CARLA Ackermann (sim) +# +# adapter_params 는 기존 vehicle_mkmini.yaml 의 cmd_vel_to_ackermann 섹션에서 그대로 이전. +# +# Phase 1 Step 2: dormant. +vehicle_driver: + name: carla_ackermann + display_name: CARLA Ackermann (sim) + adapter: ackermann_carla # registry.py 키 → cmd_vel_to_ackermann 노드 + driver_topic: /carla/hero/ackermann_cmd + + # CARLA 제어 노드 (sim). launch 는 빈 값 — Step 4 인터프리터가 Node 로 직접 spawn 처리 + driver_launch: + package: carla_ackermann_control + launch: "" + + # = 기존 vehicle_mkmini.yaml cmd_vel_to_ackermann.ros__parameters + # (wheelbase / max_steering_angle 는 platform 프로파일에서 launch 시 주입) + adapter_params: + input_topic: /cmd_vel + output_topic: /carla/hero/ackermann_cmd + angular_deadband: 0.06 + min_speed_for_steer: 0.15 + max_speed: 0.6 + acceleration: 0.0 + jerk: 0.0 diff --git a/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_fr09_tod.yaml b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_fr09_tod.yaml new file mode 100755 index 0000000..0f1d3d1 --- /dev/null +++ b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_fr09_tod.yaml @@ -0,0 +1,25 @@ +# Vehicle driver profile — FR-09 TOD (실차) +# +# yhs_can 과 동일한 cmd_vel_to_tod 어댑터지만 하드웨어 driver include 없음 +# (fr09 실차는 과거 Autoware-fed, 전용 비-Autoware 드라이버 미존재 — 추후 붙일 것). +# adapter_params 는 기존 vehicle_fr09.yaml 의 cmd_vel_to_tod 섹션에서 그대로 이전. +# +# Phase 1 Step 4. +vehicle_driver: + name: fr09_tod + display_name: FR09 TOD + adapter: ackermann_tod # registry.py 키 → cmd_vel_to_tod 노드 + driver_topic: /tod_cmd + + driver_launch: # 하드웨어 driver 없음 + package: "" + launch: "" + + # = 기존 vehicle_fr09.yaml cmd_vel_to_tod.ros__parameters + # (wheelbase / max_steering_angle 는 platform 프로파일에서 launch 시 주입) + adapter_params: + input_topic: /cmd_vel + output_topic: /tod_cmd + angular_deadband: 0.06 + min_speed_for_steer: 0.15 + max_speed: 0.3 diff --git a/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_gazebo_passthrough.yaml b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_gazebo_passthrough.yaml new file mode 100644 index 0000000..92eef4b --- /dev/null +++ b/src/vehicle_pkg/config/vehicle_drivers/vehicle_driver_gazebo_passthrough.yaml @@ -0,0 +1,9 @@ +# Gazebo TurtleBot3 subscribes to geometry_msgs/Twist on /cmd_vel directly. +vehicle_driver: + name: gazebo_passthrough + display_name: Gazebo Twist passthrough + adapter: "" + driver_launch: + package: "" + launch: "" + adapter_params: {} diff --git a/src/vehicle_pkg/config/vehicle_fr09.yaml b/src/vehicle_pkg/config/vehicle_fr09.yaml new file mode 100755 index 0000000..3df8214 --- /dev/null +++ b/src/vehicle_pkg/config/vehicle_fr09.yaml @@ -0,0 +1,26 @@ +# File: vehicle_fr09.yaml +# Description: Vehicle interface parameters for FR-09 + +# cmd_vel (linear + angular) → AckermannDriveStamped → carla_ackermann_control (sim) +cmd_vel_to_ackermann: + ros__parameters: + input_topic: /cmd_vel + output_topic: /carla/hero/ackermann_cmd + wheelbase: 0.856 # 축간 거리 (m) + max_steering_angle: 0.463 # 최대 조향각 (rad) + angular_deadband: 0.06 # 이 이하의 angular_vel은 직진으로 처리 + min_speed_for_steer: 0.15 # 조향 적용 최소 속도 (m/s) + max_speed: 0.6 # 최대 속도 (m/s) + acceleration: 0.0 + jerk: 0.0 + +# cmd_vel (linear + angular) → /tod_cmd Float64MultiArray → yhs_can_control (real) +cmd_vel_to_tod: + ros__parameters: + input_topic: /cmd_vel + output_topic: /tod_cmd + wheelbase: 0.856 # 축간 거리 (m) + max_steering_angle: 0.463 # 최대 조향각 (rad) + angular_deadband: 0.06 # 이 이하의 angular_vel은 직진으로 처리 + min_speed_for_steer: 0.15 # 조향 적용 최소 속도 (m/s) + max_speed: 0.3 # 최대 속도 (m/s) diff --git a/src/vehicle_pkg/config/vehicle_mkmini.yaml b/src/vehicle_pkg/config/vehicle_mkmini.yaml new file mode 100755 index 0000000..2208360 --- /dev/null +++ b/src/vehicle_pkg/config/vehicle_mkmini.yaml @@ -0,0 +1,29 @@ +# File: vehicle_mkmini.yaml +# Description: Vehicle interface parameters for MK-Mini +# +# sim_mode=true → cmd_vel_to_ackermann 노드가 이 파일의 cmd_vel_to_ackermann 섹션 참조 +# sim_mode=false → cmd_vel_to_tod 노드가 이 파일의 cmd_vel_to_tod 섹션 참조 + +# cmd_vel (linear + angular) → AckermannDrive [시뮬용] +cmd_vel_to_ackermann: + ros__parameters: + input_topic: /cmd_vel + output_topic: /carla/hero/ackermann_cmd + wheelbase: 0.6 # 축간 거리 (m) + max_steering_angle: 0.5 # 최대 조향각 (rad) + angular_deadband: 0.06 + min_speed_for_steer: 0.15 + max_speed: 0.6 + acceleration: 0.0 + jerk: 0.0 + +# cmd_vel (linear + angular) → /tod_cmd (Float64MultiArray) [실차용] +cmd_vel_to_tod: + ros__parameters: + input_topic: /cmd_vel + output_topic: /tod_cmd + wheelbase: 0.6 # 축간 거리 (m) + max_steering_angle: 0.5 # 최대 조향각 (rad) + angular_deadband: 0.06 + min_speed_for_steer: 0.15 + max_speed: 0.3 # 실차 안전 속도 상한 (m/s) diff --git a/src/vehicle_pkg/launch/__pycache__/vehicle.launch.cpython-310.pyc b/src/vehicle_pkg/launch/__pycache__/vehicle.launch.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4322529c35ba84ced7b3bc4f6052fa47bc22789 GIT binary patch literal 3178 zcmbVONsr`66?S+_r*qHBs>-bD>U~QzRQ2?*%t#2)Ov4BXdPX#Gh@oY<9FbY>@-`9S z>P5~|b3j5Vjo^mrP=%NS(j2+)2e|MLe1ro+jkqC!G<5UAcDieN#06V^jxXMeh!-#7 zeGze|V=M54f7*YjTve36NO1NU0{9ku{3cQqq7W1)SpL-jg(_B&ENg)l>R2zzdSHYm zHp2#Pgci2KCTMqr06+$zdu&<;DeQvbE|gxy_iUK z_XC%?Ar+MU#0^qe(`J;%!4Y+mz>RW?`=JwpZLSMe=sSeY+%yo*k!+9~flpk9%{b-I z2|#*8gB-e#=u~5Ji(&OP!RlLNs=TA|TJh=E%ZLzr+FD63GHen`PD=#YVw#XrzXXn3 z5hlmYB;9wsAodQi2?R^2WY@%OtDPFNh2`iew!&fxnBrKl!fuy=3UNVrlopLx2fH#F7(y75NLnXT+ z1)RbPyC!Yyf{7&Wa_A4HvWi{FYA|KH;8#aHNn{_dtxz$TT!Xyf5;uWvUK=GhORAgp zSyPVJ0G}n*GGHEswPi~+=DD7@;vm-_0>kB|n>w(WjZuo+R zoV5xa7i@YC$UKe&kZ-QT((v3od?f#`yZe7`sLtwuaO4ugk{`~?a~A9JaKah{83It8 zg&eoby;JTKtbs9ZRog}`5xW6y<0fH8WgqN1;NL0iEAabg0%GqV4(XnE@Fb4+p8w*v zfB*IGpPwE-|JCsx9Div*`QC@KRGvp)u9oUSa1lw$6?H)DOrW49$NDqKp3bYiX9Msy0%K*Zj;fb=24T$ds?z*NZ<=|7E|>J2ujh z^>Wx8A`7%C^s2t>s`h`n4HIfqS@+UZWlz>;)(f*`p`l?STQ&b}y|C70PeWuQ>xFKx zuYp@0eDxzwG`T^s)fc75cZDjWs}{6AKr%D6bZ;cn1h!IatX`|_i(rDdbiqT zOqZI%xgt-bhxk%u^F=QlUfjcYkxzJ3+3|Fr3ty!2F2>9J99C^v%}~0&j9oGHGoh0ko)z)4zEN)NZ^~um($;FV)iwl7%HmaR%|?CL R5B00pC8*Q?VQsX-{{o`bS|k7f literal 0 HcmV?d00001 diff --git a/src/vehicle_pkg/launch/carla_spawn_hero.launch.py b/src/vehicle_pkg/launch/carla_spawn_hero.launch.py new file mode 100755 index 0000000..ccd08c2 --- /dev/null +++ b/src/vehicle_pkg/launch/carla_spawn_hero.launch.py @@ -0,0 +1,132 @@ +import os + +import launch +from launch.substitutions import LaunchConfiguration, PathJoinSubstitution +from launch.substitutions import TextSubstitution +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.actions import (DeclareLaunchArgument, IncludeLaunchDescription, + OpaqueFunction, TimerAction) +from ament_index_python.packages import get_package_share_directory + + +def _sensor_spawns(context, *args, **kwargs): + """lidar/imu 스폰 (vehicle spawn 후 3초 지연 — actor_list 안정화 대기). + + TimerAction 의 actions 는 fire 시점에 root context 에서 substitution 을 + 해석한다 — 부모 include 가 launch_arguments 로 덮은 'lidar'(자식 context, + 예: 플랫폼 프로파일 sim_lidar=vanjee)가 아니라 호출자 원본 값(예: SLAM 이 + 보낸 드라이버 키 carla_lidar)이 읽히는 launch 함정. 여기서 include 처리 + 시점에 perform 해 경로를 문자열로 고정한다.""" + vehicle_pkg_share = get_package_share_directory('vehicle_pkg') + robot = LaunchConfiguration('robot').perform(context) + lidar = LaunchConfiguration('lidar').perform(context) + spawn_sensor_launch = os.path.join( + vehicle_pkg_share, 'launch', 'carla_spawn_sensor.launch.py') + actions = [] + if LaunchConfiguration('spawn_lidar').perform(context) == 'true': + actions.append(TimerAction(period=3.0, actions=[ + IncludeLaunchDescription( + PythonLaunchDescriptionSource(spawn_sensor_launch), + launch_arguments={ + 'objects_definition_file': os.path.join( + vehicle_pkg_share, 'config', f'{robot}-carla', + f'{lidar}_lidar.json'), + }.items(), + ), + ])) + if LaunchConfiguration('spawn_imu').perform(context) == 'true': + actions.append(TimerAction(period=3.0, actions=[ + IncludeLaunchDescription( + PythonLaunchDescriptionSource(spawn_sensor_launch), + launch_arguments={ + 'objects_definition_file': os.path.join( + vehicle_pkg_share, 'config', f'{robot}-carla', + 'imu.json'), + }.items(), + ), + ])) + return actions + + +def generate_launch_description(): + robot = LaunchConfiguration('robot') + lidar = LaunchConfiguration('lidar') + spawn_point = LaunchConfiguration('spawn_point') + control_id = LaunchConfiguration('control_id') + + spawn_lidar = LaunchConfiguration('spawn_lidar') + spawn_imu = LaunchConfiguration('spawn_imu') + + vehicle_pkg_share = get_package_share_directory('vehicle_pkg') + carla_spawn_objects_share = get_package_share_directory('carla_spawn_objects') + + return launch.LaunchDescription([ + DeclareLaunchArgument( + name='robot', + default_value='fr09' + ), + DeclareLaunchArgument( + name='lidar', + default_value='vanjee', + choices=['vanjee', 'ouster'] + ), + DeclareLaunchArgument( + name='spawn_point', + default_value='None' + ), + DeclareLaunchArgument( + name='control_id', + default_value='control' + ), + DeclareLaunchArgument( + name='spawn_lidar', + default_value='true', + description='Whether to spawn lidar sensor' + ), + DeclareLaunchArgument( + name='spawn_imu', + default_value='true', + description='Whether to spawn imu sensor' + ), + + # vehicle spawn + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join( + vehicle_pkg_share, + 'launch', + 'carla_spawn_vehicle.launch.py' + ) + ), + launch_arguments={ + 'objects_definition_file': PathJoinSubstitution([ + vehicle_pkg_share, + 'config', + [robot, TextSubstitution(text='-carla')], + 'hero.json' + ]), + 'spawn_point': spawn_point + }.items() + ), + + # lidar/imu spawn — TimerAction root-context 함정 때문에 경로를 + # include 처리 시점에 고정한다 (_sensor_spawns 주석 참조). + OpaqueFunction(function=_sensor_spawns), + + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join( + carla_spawn_objects_share, + 'set_initial_pose.launch.py' + ) + ), + launch_arguments={ + 'role_name': 'hero', + 'control_id': control_id + }.items() + ) + ]) + + +if __name__ == '__main__': + generate_launch_description() \ No newline at end of file diff --git a/src/vehicle_pkg/launch/carla_spawn_sensor.launch.py b/src/vehicle_pkg/launch/carla_spawn_sensor.launch.py new file mode 100755 index 0000000..357f8a3 --- /dev/null +++ b/src/vehicle_pkg/launch/carla_spawn_sensor.launch.py @@ -0,0 +1,37 @@ +import os +import sys + +import launch +import launch_ros.actions +from ament_index_python.packages import get_package_share_directory + + +def generate_launch_description(): + ld = launch.LaunchDescription([ + launch.actions.DeclareLaunchArgument( + name='objects_definition_file', + default_value=os.path.join(get_package_share_directory( + 'carla_spawn_objects'), 'config', 'fr09', 'imu.json') + ), + + launch_ros.actions.Node( + package='carla_spawn_objects', + executable='carla_spawn_objects', + name='carla_spawn_objects', + output='screen', + emulate_tty=True, + parameters=[ + { + 'objects_definition_file': launch.substitutions.LaunchConfiguration('objects_definition_file') + }, + { + 'spawn_sensors_only': True + } + ] + ) + ]) + return ld + + +if __name__ == '__main__': + generate_launch_description() diff --git a/src/vehicle_pkg/launch/carla_spawn_vehicle.launch.py b/src/vehicle_pkg/launch/carla_spawn_vehicle.launch.py new file mode 100755 index 0000000..8fbd170 --- /dev/null +++ b/src/vehicle_pkg/launch/carla_spawn_vehicle.launch.py @@ -0,0 +1,44 @@ +import os +import sys + +import launch +import launch_ros.actions +from ament_index_python.packages import get_package_share_directory + + +def generate_launch_description(): + ld = launch.LaunchDescription([ + launch.actions.DeclareLaunchArgument( + name='objects_definition_file', + default_value=os.path.join(get_package_share_directory( + 'carla_spawn_objects'), 'config', 'fr09', 'hero.json') + ), + launch.actions.DeclareLaunchArgument( + name='spawn_point', + default_value='None' + ), + + launch_ros.actions.Node( + package='carla_spawn_objects', + executable='carla_spawn_objects', + name='carla_spawn_objects', + output='screen', + emulate_tty=True, + parameters=[ + { + 'objects_definition_file': launch.substitutions.LaunchConfiguration('objects_definition_file') + }, + { + 'spawn_point': launch.substitutions.LaunchConfiguration('spawn_point') + }, + { + 'spawn_sensors_only': False + } + ] + ) + ]) + return ld + + +if __name__ == '__main__': + generate_launch_description() diff --git a/src/vehicle_pkg/launch/vehicle.launch.py b/src/vehicle_pkg/launch/vehicle.launch.py new file mode 100755 index 0000000..bb2b2f1 --- /dev/null +++ b/src/vehicle_pkg/launch/vehicle.launch.py @@ -0,0 +1,159 @@ +# File: vehicle.launch.py +# Description: +# 차량 인터페이스 — 데이터 주도(platform 프로파일 기반) 진입점. +# platform 프로파일을 읽어 driver include / cmd_vel 어댑터 / sensor_bridge 를 동적 spawn. +# 새 플랫폼 추가 = config/{platforms,vehicle_drivers,sensor_drivers}/*.yaml 추가 +# (+ 신규 하드웨어면 driver 패키지) — 이 파일 무수정. +# +# 표준 토픽 유지: Nav2 는 /cmd_vel 만 출력하고 /scan·/odom_custom·/tf 만 본다 (차량/센서 모름). +# +# legacy 호환: platform 미지정 시 robot 인자를 platform 으로 사용 (robot:=mkmini → platform=mkmini). + +import os + +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.actions import (DeclareLaunchArgument, GroupAction, + IncludeLaunchDescription, OpaqueFunction) +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node +from launch_ros.descriptions import ParameterValue + +from vehicle_pkg.profiles import resolve_plan + +ARGUMENTS = [ + DeclareLaunchArgument('sim_mode', default_value='true'), + DeclareLaunchArgument('lidar', default_value='ouster'), # carla spawn 용 (choices 완화) + DeclareLaunchArgument('level', default_value='None', choices=['None', '2d', '3d']), + DeclareLaunchArgument('platform', default_value=''), # 진입점 (미지정 시 robot 사용) + DeclareLaunchArgument('robot', default_value='fr09'), # legacy 호환 + DeclareLaunchArgument('vehicle_driver', default_value=''), # override (real, 미지정=platform 기본) + DeclareLaunchArgument('sensor_driver', default_value=''), # override (real, 미지정=platform 기본) + DeclareLaunchArgument('extra_config_dirs', default_value=''), # 드라이버 ws 루트(콜론 구분) + # 드라이버가 독립 모듈 컨테이너로 이미 구동 중인 흐름(Execute, 선택 즉시 실행)이면 + # 'true' — (b) driver include 를 건너뛰어 중복 기동(CAN/UDP 충돌)을 막는다. + # SLAM 흐름은 아직 vehicle 내장 include 방식이라 기본값 false 유지. + DeclareLaunchArgument('external_drivers', default_value='false'), + DeclareLaunchArgument('sensor_driver_params', default_value=''), # base64(JSON) 오버라이드 + DeclareLaunchArgument('vehicle_driver_params', default_value=''), + DeclareLaunchArgument('perception', default_value='[]'), + DeclareLaunchArgument('spawn_point', default_value='8.0,0.0,0.1,0.0,0.0,270.0'), + DeclareLaunchArgument('spawn_lidar', default_value='true'), + DeclareLaunchArgument('spawn_imu', default_value='true'), +] + + +def build(context, *args, **kwargs): + sim_mode = LaunchConfiguration('sim_mode').perform(context) + lidar = LaunchConfiguration('lidar').perform(context) + level = LaunchConfiguration('level').perform(context) + platform = LaunchConfiguration('platform').perform(context) + robot = LaunchConfiguration('robot').perform(context) + vehicle_driver = LaunchConfiguration('vehicle_driver').perform(context) + sensor_driver = LaunchConfiguration('sensor_driver').perform(context) + extra_config_dirs = LaunchConfiguration('extra_config_dirs').perform(context) + sensor_driver_params = LaunchConfiguration('sensor_driver_params').perform(context) + vehicle_driver_params = LaunchConfiguration('vehicle_driver_params').perform(context) + perception = LaunchConfiguration('perception').perform(context) + spawn_point = LaunchConfiguration('spawn_point').perform(context) + spawn_lidar = LaunchConfiguration('spawn_lidar').perform(context) + spawn_imu = LaunchConfiguration('spawn_imu').perform(context) + + # legacy 호환: platform 미지정이면 robot 을 platform 으로 사용 + platform_name = platform or robot + + pkg_share = get_package_share_directory('vehicle_pkg') + # 프로파일 해소 (없는 platform/driver 면 여기서 명확한 FileNotFoundError = launch-time self-check) + plan = resolve_plan( + pkg_share, platform_name, sim_mode, vehicle_driver, sensor_driver, + extra_config_dirs=extra_config_dirs, + sensor_driver_params=sensor_driver_params, + vehicle_driver_params=vehicle_driver_params) + + sim = (sim_mode == 'true') + actions = [] + + # (a) spawn: CARLA only. Gazebo simulator owns the TurtleBot3 entity. + if sim and plan['simulator'] == 'carla': + spawn_launch = os.path.join(pkg_share, 'launch', 'carla_spawn_hero.launch.py') + actions.append(IncludeLaunchDescription( + PythonLaunchDescriptionSource(spawn_launch), + launch_arguments=[ + ('robot', platform_name), # {platform}-carla/ config dir 선택 + # blueprint 정체성 = plan(플랫폼 sim_lidar) 우선, raw arg 폴백. + # SLAM 흐름은 lidar 에 센서 드라이버 키(carla_lidar)를 실어 보내는데 + # 그대로 넘기면 spawn 의 choices(['vanjee','ouster'])에서 즉사한다. + ('lidar', plan.get('lidar') or lidar), + ('spawn_point', spawn_point), + ('spawn_lidar', spawn_lidar), + ('spawn_imu', spawn_imu), + ], + )) + elif not sim: + actions.append(Node(package='vehicle_pkg', executable='pub_clock', + name='pub_clock', output='screen')) + + # (b) 하드웨어 driver include (프로파일이 선언한 것만; 센서→차량 순). + # params 는 profiles 가 병합한 문자열 dict — 드라이버 launch 의 동명 + # DeclareLaunchArgument 로 전달 (선언 없으면 빈 dict → 인자 전달 안 함). + # external_drivers=true(Execute 흐름)면 드라이버는 독립 모듈 컨테이너가 + # 담당하므로 여기서 include 하지 않는다 (중복 기동 방지). 프로파일의 + # 어댑터/브리지/lidar_id 해석은 위 resolve_plan 에서 이미 끝났다. + if LaunchConfiguration('external_drivers').perform(context) != 'true': + for pkg, launch_file, params in plan['driver_includes']: + drv_share = get_package_share_directory(pkg) + actions.append(IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(drv_share, 'launch', launch_file)), + launch_arguments=(list(params.items()) or None))) + + # (c) Gazebo already publishes native /scan, /odom, and /tf. CARLA/real + # stacks still normalize their hardware sensor topics through this bridge. + if plan['simulator'] != 'gazebo': + actions.append(Node( + package='vehicle_pkg', executable='sensor_bridge', name='sensor_bridge', output='screen', + parameters=[{ + **plan['sensor_bridge_params'], + 'robot': plan['perception_profile'], + 'sim_mode': sim_mode, + 'use_sim_time': sim, + }], + )) + + # (d) pub_vehicle_config (/vehicle_config 의 robot 키 = perception_profile → 다운스트림 {robot} 규칙 보존) + actions.append(Node( + package='vehicle_pkg', executable='pub_vehicle_config', name='pub_vehicle_config', output='screen', + parameters=[{ + # pub_vehicle_config 는 sim_mode 를 BOOL 로 선언 → Python bool 전달 (sensor_bridge 는 STRING 선언이라 위에서 문자열 전달). + # lidar: 플랫폼 sensor_driver 프로파일에 lidar_id 가 있으면 그 값(실차 정체성, 예 f1tenth=hokuyo), + # 없으면 raw launch arg(carla spawn 등) 폴백 → 타 플랫폼 현행 동작 유지. + 'sim_mode': sim, 'lidar': (plan.get('lidar') or lidar), 'level': level, + 'robot': plan['perception_profile'], + # perception 은 base64 문자열. value_type=str 강제 안 하면 launch_ros 가 '[]' 를 빈 리스트로 해석해 크래시. + 'perception': ParameterValue(perception, value_type=str), + }], + )) + + # (e) CARLA 제어 노드는 simulator 모듈 소관 — simulator.launch.py 가 동일 파라미터 + # (settings.yaml + role_name hero + control_loop_rate 0.05)로 이미 spawn 한다. + # vehicle 컨테이너에는 carla_ackermann_control 패키지가 없어 여기서 띄우면 + # launch 가 PackageNotFound 로 즉사하고, 패키지가 있어도 노드 이름이 중복된다. + # 어댑터(f)가 발행하는 /carla/hero/ackermann_cmd 를 simulator 쪽 노드가 + # 구독하는 토픽 계약만 유지한다. + + # (f) Gazebo TurtleBot3 consumes /cmd_vel directly, so no adapter is needed. + adapter = plan['adapter'] + if adapter: + actions.append(Node( + package=adapter['package'], executable=adapter['executable'], name=adapter['name'], + output='screen', parameters=[adapter['params']], + )) + + return actions + + +def generate_launch_description(): + ld = LaunchDescription(ARGUMENTS) + ld.add_action(GroupAction(actions=[OpaqueFunction(function=build)])) + return ld diff --git a/src/vehicle_pkg/package.xml b/src/vehicle_pkg/package.xml new file mode 100755 index 0000000..021fab7 --- /dev/null +++ b/src/vehicle_pkg/package.xml @@ -0,0 +1,22 @@ + + + + vehicle_pkg + 0.0.0 + TODO: Package description + dgist + TODO: License declaration + + + rclpy + sensor_msgs + + ament_copyright + ament_flake8 + ament_pep257 + python3-pytest + + + ament_python + + diff --git a/src/vehicle_pkg/resource/vehicle_pkg b/src/vehicle_pkg/resource/vehicle_pkg new file mode 100755 index 0000000..e69de29 diff --git a/src/vehicle_pkg/setup.cfg b/src/vehicle_pkg/setup.cfg new file mode 100755 index 0000000..a0cfc9e --- /dev/null +++ b/src/vehicle_pkg/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script_dir=$base/lib/vehicle_pkg +[install] +install_scripts=$base/lib/vehicle_pkg diff --git a/src/vehicle_pkg/setup.py b/src/vehicle_pkg/setup.py new file mode 100755 index 0000000..e2be388 --- /dev/null +++ b/src/vehicle_pkg/setup.py @@ -0,0 +1,48 @@ + +import os +from glob import glob +from setuptools import find_packages, setup + +package_name = 'vehicle_pkg' + +setup( + name=package_name, + version='0.0.0', + packages=find_packages(exclude=['test']), + data_files=[ + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ('share/' + package_name, ['package.xml']), + (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')), + (os.path.join('share', package_name, 'config'), glob('config/*.yaml')), + (os.path.join('share', package_name, 'config', 'fr09-carla'), glob('config/fr09-carla/*.json')), + (os.path.join('share', package_name, 'config', 'mkmini-carla'), glob('config/mkmini-carla/*.json')), + (os.path.join('share', package_name, 'config', 'platforms'), glob('config/platforms/*.yaml')), + (os.path.join('share', package_name, 'config', 'vehicle_drivers'), glob('config/vehicle_drivers/*.yaml')), + (os.path.join('share', package_name, 'config', 'sensor_drivers'), glob('config/sensor_drivers/*.yaml')), + ], + install_requires=['setuptools'], + zip_safe=True, + maintainer='dgist', + maintainer_email='jang1future@gmail.com', + description='TODO: Package description', + license='TODO: License declaration', + extras_require={ + 'test': [ + 'pytest', + ], + }, + entry_points={ + 'console_scripts': [ + 'test = vehicle_pkg.test:main', + 'pub_vehicle_config = vehicle_pkg.pub_vehicle_config:main', + 'cmd_vel_to_ackermann = vehicle_pkg.cmd_vel_to_ackermann:main', + 'cmd_vel_to_ackermann_stamped = vehicle_pkg.cmd_vel_to_ackermann_stamped:main', + 'cmd_vel_to_tod = vehicle_pkg.cmd_vel_to_tod:main', + 'sensor_bridge = vehicle_pkg.sensor_bridge:main', + 'pub_clock = vehicle_pkg.pub_clock:main', + 'wasd_teleop = vehicle_pkg.wasd_teleop:main', + 'wasd_teleop_pg = vehicle_pkg.wasd_teleop_pg:main', + ], + }, +) diff --git a/src/vehicle_pkg/test/test_copyright.py b/src/vehicle_pkg/test/test_copyright.py new file mode 100755 index 0000000..97a3919 --- /dev/null +++ b/src/vehicle_pkg/test/test_copyright.py @@ -0,0 +1,25 @@ +# 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. + +from ament_copyright.main import main +import pytest + + +# 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' diff --git a/src/vehicle_pkg/test/test_flake8.py b/src/vehicle_pkg/test/test_flake8.py new file mode 100755 index 0000000..27ee107 --- /dev/null +++ b/src/vehicle_pkg/test/test_flake8.py @@ -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. + +from ament_flake8.main import main_with_errors +import pytest + + +@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) diff --git a/src/vehicle_pkg/test/test_pep257.py b/src/vehicle_pkg/test/test_pep257.py new file mode 100755 index 0000000..b234a38 --- /dev/null +++ b/src/vehicle_pkg/test/test_pep257.py @@ -0,0 +1,23 @@ +# 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. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found code style errors / warnings' diff --git a/src/vehicle_pkg/test/test_perception_decode.py b/src/vehicle_pkg/test/test_perception_decode.py new file mode 100755 index 0000000..66e2197 --- /dev/null +++ b/src/vehicle_pkg/test/test_perception_decode.py @@ -0,0 +1,24 @@ +import base64, json +from vehicle_pkg.perception_arg import decode_perception + +def test_plain_empty(): + assert decode_perception('[]') == [] + +def test_plain_json(): + assert decode_perception('[{"package":"x"}]') == [{"package":"x"}] + +def test_base64_payload(): + # LocalLauncher buildPerceptionArg 실제 페이로드 형태 (perception__pkg) + payload = [{"category": "object_detection", + "package": "perception_pointpillars_pkg", + "launch": "perception.launch.py", + "args": {"robot": "mkmini", "use_sim_time": "true", + "model_source": "finetuned"}}] + b64 = base64.b64encode(json.dumps(payload).encode()).decode() + assert decode_perception(b64) == payload + +def test_garbage_returns_empty(): + assert decode_perception('@@notjson@@') == [] + +def test_none_returns_empty(): + assert decode_perception(None) == [] diff --git a/src/vehicle_pkg/test/test_profiles.py b/src/vehicle_pkg/test/test_profiles.py new file mode 100755 index 0000000..f4182f9 --- /dev/null +++ b/src/vehicle_pkg/test/test_profiles.py @@ -0,0 +1,157 @@ +"""profiles.py 오프라인 parity — extra_dirs 탐색 + 파라미터 병합 (ROS 비의존).""" +import base64 +import json +import os +import sys + +import pytest + +_SRC = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +sys.path.insert(0, _SRC) + +from vehicle_pkg.profiles import ( # noqa: E402 + _merge_params, load_sensor_driver, load_vehicle_driver, resolve_plan, +) + +PKG_SHARE = _SRC # 소스 트리 config/ 를 pkg_share 로 사용 + +USER_DRIVER_YAML = """\ +vehicle_driver: + name: zzz + display_name: ZZZ + adapter: vesc + compatible_platforms: [f1tenth] + driver_launch: + package: zzz_pkg + launch: zzz.launch.py + parameters: + - name: serial_port + type: string + default: /dev/ttyUSB0 + - name: baudrate + type: int + default: 115200 + - name: use_odom + type: bool + default: true +""" + + +def _b64(d): + return base64.b64encode( + json.dumps(d, separators=(',', ':')).encode()).decode() + + +@pytest.fixture +def extra_dir(tmp_path): + d = tmp_path / 'config' / 'vehicle_drivers' + d.mkdir(parents=True) + (d / 'vehicle_driver_zzz.yaml').write_text(USER_DRIVER_YAML) + # R2-9 분리 후 platform 기본 sensor(hokuyo)도 extra 에서 온다 — 최소 스텁 + s = tmp_path / 'config' / 'sensor_drivers' + s.mkdir(parents=True) + (s / 'sensor_driver_hokuyo.yaml').write_text( + 'sensor_driver:\n name: hokuyo\n display_name: stub\n') + return str(tmp_path) + + +def test_extra_dirs_lookup(extra_dir): + prof = load_vehicle_driver(PKG_SHARE, 'zzz', [extra_dir]) + assert prof['name'] == 'zzz' + + +def test_pkg_share_first_then_extra(extra_dir): + # 잔류 공식(carla_ackermann)은 pkg_share 에서, 없는 것은 extra 에서 + assert load_vehicle_driver( + PKG_SHARE, 'carla_ackermann', [extra_dir])['name'] == 'carla_ackermann' + with pytest.raises(FileNotFoundError): + load_vehicle_driver(PKG_SHARE, 'nope', [extra_dir]) + + +def test_merge_defaults_only(): + prof = {'name': 'zzz', 'parameters': [ + {'name': 'baudrate', 'type': 'int', 'default': 115200}, + {'name': 'use_odom', 'type': 'bool', 'default': True}]} + merged = _merge_params(prof, 'vehicle_driver', '') + assert merged == {'baudrate': '115200', 'use_odom': 'true'} + + +def test_merge_override_and_bool_format(): + prof = {'name': 'zzz', 'parameters': [ + {'name': 'baudrate', 'type': 'int', 'default': 115200}, + {'name': 'use_odom', 'type': 'bool', 'default': True}]} + merged = _merge_params(prof, 'vehicle_driver', + _b64({'baudrate': 9600, 'use_odom': False})) + assert merged == {'baudrate': '9600', 'use_odom': 'false'} + + +def test_merge_unknown_key_raises(): + prof = {'name': 'zzz', 'parameters': [ + {'name': 'baudrate', 'type': 'int', 'default': 115200}]} + with pytest.raises(ValueError): + _merge_params(prof, 'vehicle_driver', _b64({'typo': 1})) + + +def test_no_declaration_empty(): + assert _merge_params({'name': 'vesc'}, 'vehicle_driver', '') == {} + + +def test_resolve_plan_user_vehicle_override(extra_dir): + plan = resolve_plan( + PKG_SHARE, 'f1tenth', 'false', + vehicle_driver_arg='zzz', + extra_config_dirs=extra_dir, + vehicle_driver_params=_b64({'baudrate': 9600})) + includes = {(p, f): params for p, f, params in plan['driver_includes']} + assert ('zzz_pkg', 'zzz.launch.py') in includes + assert includes[('zzz_pkg', 'zzz.launch.py')] == { + 'serial_port': '/dev/ttyUSB0', 'baudrate': '9600', 'use_odom': 'true'} + + +# ---- 내장 드라이버 분리 (R2-9) ---- +# 내장 4종 프로파일은 pkg_share 가 아니라 설치된 드라이버 모듈 ws +# (.caches 형제 폴더)의 config/ 가 extra_config_dirs 로 넘어와 해소된다. +_CACHES = os.path.abspath(os.path.join(_SRC, '..', '..', '..')) + + +def _driver_ws(key): + return os.path.join(_CACHES, f'[furive-driver]driver-{key}_v1.0.0_ws') + + +_F1_DIRS = [_driver_ws('vesc'), _driver_ws('hokuyo')] +_MK_DIRS = [_driver_ws('vanjee'), _driver_ws('yhs_can')] + + +def test_builtin_removed_from_pkg_share(): + """R2-9 가드 — 내장 4종 프로파일은 더 이상 vehicle_pkg 에 없다.""" + for k in ('vesc', 'yhs_can'): + with pytest.raises(FileNotFoundError): + load_vehicle_driver(PKG_SHARE, k, []) + for k in ('vanjee', 'hokuyo'): + with pytest.raises(FileNotFoundError): + load_sensor_driver(PKG_SHARE, k, []) + + +@pytest.mark.skipif(not all(os.path.isdir(d) for d in _F1_DIRS), + reason='f1tenth 드라이버 모듈 미설치') +def test_resolve_plan_official_f1tenth_params(): + """분리된 드라이버 모듈 ws 의 선언 기본값이 launch arg 로 흐른다.""" + plan = resolve_plan(PKG_SHARE, 'f1tenth', 'false', + extra_config_dirs=':'.join(_F1_DIRS)) + includes = {(p, f): params for p, f, params in plan['driver_includes']} + assert includes[('hokuyo_bringup', 'f1tenth_hokuyo.launch.py')] == { + 'ip_address': '192.168.0.10'} + assert includes[('vesc_bringup', 'f1tenth_vesc.launch.py')] == { + 'port': '/dev/ttyACM0'} + + +@pytest.mark.skipif(not all(os.path.isdir(d) for d in _MK_DIRS), + reason='mkmini 드라이버 모듈 미설치') +def test_resolve_plan_official_mkmini_params(): + plan = resolve_plan(PKG_SHARE, 'mkmini', 'false', + extra_config_dirs=':'.join(_MK_DIRS)) + includes = {(p, f): params for p, f, params in plan['driver_includes']} + assert includes[('vanjee_bringup', 'mkmini_vanjee.launch.py')] == { + 'lidar_address': '192.168.2.86', 'host_address': '192.168.2.88'} + assert includes[('yhs_can_bringup', 'mkmini_yhs_can.launch.py')] == { + 'can_name': 'can2'} diff --git a/src/vehicle_pkg/vehicle_pkg/__init__.py b/src/vehicle_pkg/vehicle_pkg/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/src/vehicle_pkg/vehicle_pkg/__pycache__/profiles.cpython-310.pyc b/src/vehicle_pkg/vehicle_pkg/__pycache__/profiles.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e7974f81b5d05aa60da771b38d7ff5026c8036b GIT binary patch literal 5931 zcmZ`-+ix7#d7sdOqiM?yLu2HzM(6o*dq$wSQNP>=|Oh$W#)LP4( z)tOn!5@rL%q*YmF5Idr5MIjAtD___;2w^h@Q#gM?-){`1U>fAgRu{hl5U{!~2tEiUgG8YY<%lbO?|!stDhL?^_JI-M~sHuZr0Amb5@L<8=KLU zC1WzWx)NQzNmS8$KYG;o*7MUw@7Igb>dmOTS+3-A$(EIPcBOUEz&qplmVLhMJckAS zy4%FirokQ0ZOr3r4ZAs6#t_bNb1V9I1v?qho148iZySu)=N)d;o3%!pIYu>?jMwIv zHSaV8+0q+3iyKDol`XJjRQoeMr|G%eI>YO1)-k{uxb6LN3#7ewz~ky-bZaYm@3OJ| z;YPG}W9P<7@3q@Fyq4Cn1sK*ak=;I2Rkp{rfFma??Q!(MsIloj0qFCzEbVIcYEi?8@>0Ia3+$E zG5HPqBGmC$lizAL9H{Kq@Ap1jHhLTD5E69%2e^PVRhGm2tm9iYvs=EyYch={KbWMH z!S(mJyrMixm6cFy+5Xv3o>`YTZT3eOP4%oh=TvKFFS>3OtVFjq$0 z;!{VHlQZ%cb~(k80fCTkG+aU;C3Jl0MG^$UNSEALnF{rq+nlM-f?>t=I4u@xFS_+6 z=+F#tfbXLdAHY{hFM%8= zU3FIOXo1=)%}UQor%Rnwpsi`iF;gt2(Ynyk`Jq4qMWLgMx2Zty%KXtlSD>|N>AWH0 zlG=U&o9vz2h>vMRw>DtAkHVjBN2^PQ^ODbPI=eR+z5GFRYdw1Vbz>l8UGR+FzrIf% zcl|aj@haSI;q_?Y)e6sJ{i(9f3%Cn$@gntz^H8^2uo)KW&P(tbubk#2^HBBLXTsD> z)1Gs}-2UEXu4Xq`o!P$Qg)$4})}3N5T8YjrGPx62%Ns^>R4K^Eq45GPWmi-9F$~s7 z1^pkTjXg*BCLRuool-?0|6F3~s@hdMig>3%6|(oRpJM3YT}n{sqD`-+7vz^^Uk{W8 znPtWy?s9g@%=Tl5x8JosONn^WE@RUd`WAb7FWd~~g6OR)P{-58rGhcpU+kHQOD84} zgksHA`@`N|&uWv!iCsk8i#}dPxS>$GxE0-6u7sKX9LWD3TH=Q=Jv{UrTxrVnpL5$y z_7%=uF1)9##wycDS^Ov{@6riH0m>>Od=i^NCl5j!id@2_?`pdRjU$^&HPS=>M{Ysx zMXvDa*U(UKI;aasSL>*O%A~f$Pxvx4L0U@rN}#mHX5lb+(pOVL7odYK(n1%RDRZbF zG~$%z-8o?KG3?lW9L)i(3{JYYZYDl^a01%tM}odbeJOS#beG9ZsOBLni~1%>AWiD#KSEl~`FxxiH5qH6m&5G63n=CkcNr|BEL54I5P zqPI48ezq(?+Zopd(pkN1aM$aDvh7V^5df1bOEGyR)O_A{%+!qC@EqidT-~cTJ>PED zoKT|`5afK0oFUKO$z;j$T`N9?1)8tY=|#>$6wAo`F+2|_joy)*h*j^0XaZ@C@|E1u zXQhr>mtK_ug&(1W?yGAeZmp%dQdfQz>@#&y3e;yIfR5(tS1HM8V-k`|ia+J2`yM4$ zMEZa~rTt6*kNUZ^s*_*+vowPU2aueJSAiIF?f<|b2nG<^LRbLm@C>Ar=*=yIIWu;< z;TylZ^188~N`T>jdlLYBeP!~D?Kw|9X?%V9`Khwe`{<3G8|wgr27d7}(Oa1P))fLv z31<3^-Do=^ECCV&5iVRNm>YFBkgR}~jGZgL+WrVgD#1qkS~Xa`1|@IY-1*tfirB); z?H_xHzkd%E1^<({GQI5J?S}q&7EtV z`Ys4RrKLxuONNCYItvU=a`P%D8*UBubE>jOd?|mx$u23zgxIW24l{8N*&Kk`PaAjf zLZRg_F7Ht^b>d~D&x;$% zYI_d1=5hQ3{+l~V(iUu=rj1ERx}+#4cJoW}_H%YK<^Osmu%0 z?dG|rd!ZR0|4Ho21(Yie9CM1;px9DMX|g7dBBLSDBCCzcIs&e?n^P4<|3Cg^I=56K zhWkH?<`mXNc=~T3PlPAJ3-URolkw$13J|I~+1N+%4qmsWFhD!ut+^n>9}coCH7<4X zxa+tVngsyE2|OXsVN`29hCc8|r$7KQ$OpLvwNvyp^b4Y2@>4-^O=np|i!awH3JhUJ zZd?k6Sni~ReqQwR=o4K5bl+yh&Tufyzvrie;RU%Vvr^{}q5{g{K*#zc=oi^=kVgM7 zBG7113Pxs>pcovUQDziC(nr3hbdGe621l^sA*}ery3{!q9K+KHo?c-^(Lap-Ypkd! zow3e%Fvf2MZj5?2s{K{ZepG3m`DsiPr*=C|TA=1snesrrCdwT%$;mg3){dZJmu5a!m&F!s? z-bY*88$V3~a~ut0_`P4f0OwPQ`kR$rcg@)T)d#(g7Y_vT`_=@;Y5R zJqg5rs*0MGV*EgUPhugyBn%>({y3c`jsTN!y0~vvi5KUSaJjoeA?41!us*vN);Vzh z8zSWGCusyb0y~^)$^FqdHsnqcW)t!4JiUGb&82}aD+glw9_eTD)8+`NbC5&x5RDB8 z!#tWq+&f8+^v4It!%|Z8C&Dtb7tT6PgT!Ty%-JsiUN{b~H)k!oIooi;bVAPm4(FcY zj}Qw68hqOlAAS;45~f>r?VLU9n0gFTOg;XtgR;NnILw;!W=*Z>Hk~+4WWh%p_}}Gb zs%G$d5*4SkELD|qfLi(} z!>P!=(|rmDzd_bO;QatiA(xZKR86JAr2q^}*NBQca_z8q($q2ZPXHYc%gSX1@08sF zvaYU=APbi;eq2|OlNGF>=z32Zrd+Ma+Mno&f18d%5ultBmVd9NJRGJii@7z+;(tx_ z^tCLmmQ(1NqkRE`(Mta#V61kg?T-%Y+>|2WfPO*uIV-P^NQ!JU2@kg;!NFtI) iMVlsN@)@v|Q3^^%&7^W#CZEGElgp%)qr_ float: + """value를 [lower, upper] 범위로 제한""" + return max(lower, min(upper, value)) + + +class CmdVelToAckermann(Node): + def __init__(self) -> None: + super().__init__('cmd_vel_to_ackermann') + + # 파라미터 선언 및 로드 + # vehicle_params.yaml의 cmd_vel_to_ackermann 섹션에서 읽어옴 + self.declare_parameter('input_topic', '/cmd_vel') + self.declare_parameter('output_topic', '/carla/hero/ackermann_cmd') + self.declare_parameter('wheelbase', 0.6) # 축간거리 (m) — MK-Mini + self.declare_parameter('max_steering_angle', 0.5) # 최대 조향각 (rad) — MK-Mini + self.declare_parameter('angular_deadband', 0.06) # 이 이하의 angular_z는 직진 처리 + self.declare_parameter('min_speed_for_steer', 0.1) # 조향 적용 최소 속도 (m/s) + self.declare_parameter('max_speed', 5.0) # 속도 상한 (m/s) + self.declare_parameter('acceleration', 0.0) # AckermannDrive acceleration 필드 + self.declare_parameter('jerk', 0.0) # AckermannDrive jerk 필드 + + input_topic = self.get_parameter('input_topic').value + output_topic = self.get_parameter('output_topic').value + self.wheelbase = float(self.get_parameter('wheelbase').value) + self.max_steering_angle = float(self.get_parameter('max_steering_angle').value) + self.angular_deadband = float(self.get_parameter('angular_deadband').value) + self.min_speed_for_steer = float(self.get_parameter('min_speed_for_steer').value) + self.max_speed = float(self.get_parameter('max_speed').value) + self.acceleration = float(self.get_parameter('acceleration').value) + self.jerk = float(self.get_parameter('jerk').value) + + # Publisher / Subscriber + self._publisher = self.create_publisher(AckermannDrive, output_topic, 10) + self._subscription = self.create_subscription(Twist, input_topic, self._on_cmd_vel, 10) + + self.get_logger().info( + f'Converting {input_topic} -> {output_topic} ' + f'(wheelbase={self.wheelbase}, max_steering_angle={self.max_steering_angle})' + ) + + def _on_cmd_vel(self, msg: Twist) -> None: + """ + Twist → AckermannDrive 변환 콜백 + """ + linear_x = float(msg.linear.x) + angular_z = float(msg.angular.z) + + drive = AckermannDrive() + drive.speed = clamp(linear_x, -self.max_speed, self.max_speed) + drive.acceleration = self.acceleration + drive.jerk = self.jerk + drive.steering_angle_velocity = 0.0 + + if abs(linear_x) < self.min_speed_for_steer or abs(angular_z) < self.angular_deadband: + # 정지 상태이거나 각속도가 deadband 이내: 직진 유지 + drive.steering_angle = 0.0 + else: + # bicycle model: 앞바퀴 조향각 계산 + steering_angle = math.atan(self.wheelbase * angular_z / linear_x) + drive.steering_angle = clamp( + steering_angle, + -self.max_steering_angle, + self.max_steering_angle, + ) + + self._publisher.publish(drive) + + +def main(args=None) -> None: + rclpy.init(args=args) + node = CmdVelToAckermann() + try: + rclpy.spin(node) + except KeyboardInterrupt: + pass + finally: + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_ackermann_stamped.py b/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_ackermann_stamped.py new file mode 100755 index 0000000..3cd3ddc --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_ackermann_stamped.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +# File: cmd_vel_to_ackermann_stamped.py +# Description: +# Nav2가 발행하는 /cmd_vel(Twist: 선속도 + 각속도)을 +# AckermannDriveStamped(헤더 + 속도 + 조향각)로 변환하는 노드. +# +# cmd_vel_to_ackermann.py(CARLA sim, AckermannDrive 비-stamped)의 형제로, +# F1TENTH 처럼 ackermann_mux 가 AckermannDriveStamped 를 받는 경우용. +# 출력(output_topic)은 mux 의 navigation 입력 토픽(기본 'drive', prio 낮음). +# joy_teleop 가 같은 mux 의 joystick 입력(prio 높음)으로 수동 override. + +import math + +import rclpy +from ackermann_msgs.msg import AckermannDriveStamped +from geometry_msgs.msg import Twist +from rclpy.node import Node + + +def clamp(value: float, lower: float, upper: float) -> float: + """value를 [lower, upper] 범위로 제한""" + return max(lower, min(upper, value)) + + +class CmdVelToAckermannStamped(Node): + def __init__(self) -> None: + super().__init__('cmd_vel_to_ackermann_stamped') + + # 파라미터 선언 및 로드 (vehicle_driver 프로파일 adapter_params 에서 주입) + self.declare_parameter('input_topic', '/cmd_vel') + self.declare_parameter('output_topic', 'drive') # ackermann_mux navigation 입력 + self.declare_parameter('frame_id', 'base_link') + self.declare_parameter('wheelbase', 0.32) # 축간거리 (m) — 실측 주입 + self.declare_parameter('max_steering_angle', 0.32) # 최대 조향각 (rad) — 실측/역산 주입 + self.declare_parameter('angular_deadband', 0.06) # 이 이하의 angular_z는 직진 처리 + self.declare_parameter('min_speed_for_steer', 0.15) # 조향 적용 최소 속도 (m/s) + self.declare_parameter('max_speed', 1.0) # 속도 상한 (m/s) + + input_topic = self.get_parameter('input_topic').value + output_topic = self.get_parameter('output_topic').value + self.frame_id = self.get_parameter('frame_id').value + self.wheelbase = float(self.get_parameter('wheelbase').value) + self.max_steering_angle = float(self.get_parameter('max_steering_angle').value) + self.angular_deadband = float(self.get_parameter('angular_deadband').value) + self.min_speed_for_steer = float(self.get_parameter('min_speed_for_steer').value) + self.max_speed = float(self.get_parameter('max_speed').value) + + # Publisher / Subscriber + self._publisher = self.create_publisher(AckermannDriveStamped, output_topic, 10) + self._subscription = self.create_subscription(Twist, input_topic, self._on_cmd_vel, 10) + + self.get_logger().info( + f'Converting {input_topic} -> {output_topic} (AckermannDriveStamped) ' + f'(wheelbase={self.wheelbase}, max_steering_angle={self.max_steering_angle})' + ) + + def _on_cmd_vel(self, msg: Twist) -> None: + """Twist → AckermannDriveStamped 변환 콜백""" + linear_x = float(msg.linear.x) + angular_z = float(msg.angular.z) + + stamped = AckermannDriveStamped() + stamped.header.stamp = self.get_clock().now().to_msg() + stamped.header.frame_id = self.frame_id + stamped.drive.speed = clamp(linear_x, -self.max_speed, self.max_speed) + stamped.drive.steering_angle_velocity = 0.0 + + if abs(linear_x) < self.min_speed_for_steer or abs(angular_z) < self.angular_deadband: + # 정지 상태이거나 각속도가 deadband 이내: 직진 유지 + stamped.drive.steering_angle = 0.0 + else: + # bicycle model: 앞바퀴 조향각 계산 + steering_angle = math.atan(self.wheelbase * angular_z / linear_x) + stamped.drive.steering_angle = clamp( + steering_angle, + -self.max_steering_angle, + self.max_steering_angle, + ) + + self._publisher.publish(stamped) + + +def main(args=None) -> None: + rclpy.init(args=args) + node = CmdVelToAckermannStamped() + try: + rclpy.spin(node) + except KeyboardInterrupt: + pass + finally: + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_tod.py b/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_tod.py new file mode 100755 index 0000000..db606da --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/cmd_vel_to_tod.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# File: cmd_vel_to_tod.py +# Description: +# Nav2가 발행하는 /cmd_vel(Twist)을 YHS 차량 드라이버가 요구하는 +# /tod_cmd(Float64MultiArray)로 변환하는 노드. +# +# /tod_cmd 배열 구조 (yhs_can_control_node.cpp 기준): +# data[0] = velocity (m/s, 항상 >= 0; 방향은 gear로 결정) +# data[1] = brake (0.0 = 브레이크 없음) +# data[2] = steering (degrees, 전륜 조향각, bicycle model) +# data[3] = gear (4.0 = 전진, 2.0 = 후진) + +import math + +import rclpy +from geometry_msgs.msg import Twist +from rclpy.node import Node +from std_msgs.msg import Float64MultiArray + + +def clamp(value: float, lower: float, upper: float) -> float: + return max(lower, min(upper, value)) + + +class CmdVelToTod(Node): + def __init__(self) -> None: + super().__init__('cmd_vel_to_tod') + + self.declare_parameter('input_topic', '/cmd_vel') + self.declare_parameter('output_topic', '/tod_cmd') + self.declare_parameter('wheelbase', 0.856) + self.declare_parameter('max_steering_angle', 0.463) # rad + self.declare_parameter('angular_deadband', 0.06) + self.declare_parameter('min_speed_for_steer', 0.15) + self.declare_parameter('max_speed', 0.6) + + input_topic = self.get_parameter('input_topic').value + output_topic = self.get_parameter('output_topic').value + self.wheelbase = float(self.get_parameter('wheelbase').value) + self.max_steer_rad = float(self.get_parameter('max_steering_angle').value) + self.angular_db = float(self.get_parameter('angular_deadband').value) + self.min_spd_steer = float(self.get_parameter('min_speed_for_steer').value) + self.max_speed = float(self.get_parameter('max_speed').value) + + self._pub = self.create_publisher(Float64MultiArray, output_topic, 10) + self._sub = self.create_subscription(Twist, input_topic, self._on_cmd_vel, 10) + + self.get_logger().info( + f'cmd_vel_to_tod: {input_topic} -> {output_topic} ' + f'(wheelbase={self.wheelbase}, max_steer={math.degrees(self.max_steer_rad):.1f}deg)' + ) + + def _on_cmd_vel(self, msg: Twist) -> None: + linear_x = float(msg.linear.x) + angular_z = float(msg.angular.z) + + speed = clamp(abs(linear_x), 0.0, self.max_speed) + gear = 4.0 if linear_x >= 0.0 else 2.0 + + if speed < self.min_spd_steer or abs(angular_z) < self.angular_db: + steering_deg = 0.0 + else: + # bicycle model: 전륜 조향각(rad) 계산 후 degree 변환 + steer_rad = math.atan(self.wheelbase * angular_z / speed) + steer_rad = clamp(steer_rad, -self.max_steer_rad, self.max_steer_rad) + steering_deg = math.degrees(steer_rad) + + out = Float64MultiArray() + out.data = [speed, 0.0, steering_deg, gear] + self._pub.publish(out) + + +def main(args=None) -> None: + rclpy.init(args=args) + node = CmdVelToTod() + try: + rclpy.spin(node) + except KeyboardInterrupt: + pass + finally: + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/perception_arg.py b/src/vehicle_pkg/vehicle_pkg/perception_arg.py new file mode 100755 index 0000000..d18d480 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/perception_arg.py @@ -0,0 +1,16 @@ +"""순수 함수: perception launch arg(base64(json) 또는 평문 json) -> list. rclpy 의존 없음.""" +import base64 +import json + + +def decode_perception(value): + if not value: + return [] + try: + return json.loads(value) + except (ValueError, TypeError): + pass + try: + return json.loads(base64.b64decode(value).decode()) + except Exception: + return [] diff --git a/src/vehicle_pkg/vehicle_pkg/profiles.py b/src/vehicle_pkg/vehicle_pkg/profiles.py new file mode 100755 index 0000000..120ac8c --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/profiles.py @@ -0,0 +1,172 @@ +"""vehicle_pkg — 플랫폼/드라이버 프로파일 로딩 & launch 플랜 해소 (순수 로직, ROS 비의존). + +vehicle.launch.py 의 OpaqueFunction 이 resolve_plan() 을 호출해 어떤 driver include / +어떤 cmd_vel 어댑터 노드 / 어떤 sensor_bridge 파라미터를 띄울지 결정한다. + +ROS 를 import 하지 않으므로 오프라인 단위 테스트로 파라미터 parity 를 검증할 수 있다. + +선택 source = 항상 platform_*.yaml(데이터). 이 모듈/registry 는 '선택'을 하지 않고 +프로파일이 가리키는 이름을 따라 로드/매핑만 한다 (Layer 5(Rule) 침범 방지). +""" + +import base64 +import json +import os + +import yaml + +from vehicle_pkg.registry import get_adapter + + +def _load(path): + with open(path) as f: + return yaml.safe_load(f) + + +def _config_dir(pkg_share): + return os.path.join(pkg_share, 'config') + + +def _profile_path(pkg_share, sub, fname, extra_dirs=None): + """pkg_share config 우선, 다음 extra_dirs(사용자 드라이버 ws 루트들) 순 탐색.""" + candidates = [os.path.join(_config_dir(pkg_share), sub, fname)] + for d in (extra_dirs or []): + candidates.append(os.path.join(d, 'config', sub, fname)) + for p in candidates: + if os.path.exists(p): + return p + return None + + +def load_platform(pkg_share, name): + p = os.path.join(_config_dir(pkg_share), 'platforms', f'platform_{name}.yaml') + if not os.path.exists(p): + raise FileNotFoundError( + f"[profiles] platform 프로파일 없음: {p} (platform='{name}'). " + f"config/platforms/platform_{name}.yaml 를 추가하세요." + ) + return _load(p)['platform'] + + +def load_vehicle_driver(pkg_share, name, extra_dirs=None): + p = _profile_path(pkg_share, 'vehicle_drivers', + f'vehicle_driver_{name}.yaml', extra_dirs) + if p is None: + raise FileNotFoundError( + f"[profiles] vehicle_driver 프로파일 없음: '{name}' " + f"(pkg_share config + extra {list(extra_dirs or [])} 탐색)") + return _load(p)['vehicle_driver'] + + +def load_sensor_driver(pkg_share, name, extra_dirs=None): + p = _profile_path(pkg_share, 'sensor_drivers', + f'sensor_driver_{name}.yaml', extra_dirs) + if p is None: + raise FileNotFoundError( + f"[profiles] sensor_driver 프로파일 없음: '{name}' " + f"(pkg_share config + extra {list(extra_dirs or [])} 탐색)") + return _load(p)['sensor_driver'] + + +def _to_launch_str(v): + """launch argument 문자열화 — bool 은 ros launch 관례 소문자.""" + if isinstance(v, bool): + return 'true' if v else 'false' + return str(v) + + +def _merge_params(prof, kind, raw_b64): + """yaml parameters 선언 default ← 사용자 오버라이드(base64 JSON) 병합. + + 선언에 없는 키는 ValueError (오타의 조용한 통과 방지). 문자열 dict 반환. + """ + decl = prof.get('parameters') or [] + user_vals = {} + if raw_b64: + user_vals = json.loads(base64.b64decode(raw_b64).decode()) + names = {p['name'] for p in decl} + unknown = set(user_vals) - names + if unknown: + raise ValueError( + f"[profiles] {kind} '{prof.get('name')}' 선언에 없는 파라미터: " + f"{sorted(unknown)}") + return { + p['name']: _to_launch_str(user_vals.get(p['name'], p.get('default'))) + for p in decl + } + + +def resolve_plan(pkg_share, platform_name, sim_mode, + vehicle_driver_arg='', sensor_driver_arg='', + extra_config_dirs='', sensor_driver_params='', + vehicle_driver_params=''): + """platform/sim_mode/override 로 launch 플랜(dict) 해소. ROS 비의존. + + sim_mode 는 'true'/'false' 문자열. override 가 빈 문자열이면 platform 기본값 사용. + extra_config_dirs 는 콜론 구분 사용자 드라이버 ws 루트들 (프로파일 <루트>/config//). + sensor_driver_params / vehicle_driver_params 는 base64(JSON) 사용자 오버라이드. + """ + sim = (str(sim_mode) == 'true') + P = load_platform(pkg_share, platform_name) + + # 사용자 드라이버 ws 루트들 (pkg_share config 에 없는 프로파일 폴백 탐색 경로) + extra_dirs = [d for d in str(extra_config_dirs).split(':') if d] + + # 드라이버 이름 선택 (선택 source = platform 프로파일 데이터) + if sim: + vd_name = P['sim_vehicle_driver'] + sd_name = P['sim_sensor_driver'] + else: + vd_name = vehicle_driver_arg or P['default_vehicle_driver'] + sd_name = sensor_driver_arg or P['default_sensor_driver'] + + VD = load_vehicle_driver(pkg_share, vd_name, extra_dirs) + SD = load_sensor_driver(pkg_share, sd_name, extra_dirs) + + # cmd_vel 어댑터 파라미터 = adapter_params + platform 물리 제원 주입(wheelbase, max_steering_angle) + adapter_params = dict(VD.get('adapter_params') or {}) + adapter_params['wheelbase'] = P['wheelbase'] + adapter_params['max_steering_angle'] = P['max_steering_angle'] + adapter_name = VD.get('adapter') or '' + spec = get_adapter(adapter_name) if adapter_name else None + + sd_params = _merge_params(SD, 'sensor_driver', sensor_driver_params) + vd_params = _merge_params(VD, 'vehicle_driver', vehicle_driver_params) + + # 하드웨어 driver include (package+launch 둘 다 있을 때만). 순서 = 센서→차량 (기존과 동일) + driver_includes = [] + for prof, params in ((SD, sd_params), (VD, vd_params)): + dl = prof.get('driver_launch') or {} + pkg, launch_file = (dl.get('package') or ''), (dl.get('launch') or '') + if pkg and launch_file: + driver_includes.append((pkg, launch_file, params)) + + # sensor_bridge 파라미터 = bridge 매핑 + speed_msg (기존 if robot== 대체) + sensor_bridge_params = { + **(SD.get('bridge') or {}), + 'speed_msg': SD.get('speed_msg', 'none'), + } + + return { + 'platform': P['name'], + 'simulator': P.get('simulator', 'carla' if sim else 'real'), + 'drive_type': P['drive_type'], + 'perception_profile': P.get('perception_profile', P['name']), + 'lidar_frame': P.get('lidar_frame'), + # 라이다 식별자 (/vehicle_config 발행 + sim 은 CARLA 스폰 blueprint 선택에도 사용). + # 실차 = sensor_driver 프로파일 lidar_id. + # sim = platform 프로파일 sim_lidar (차량↔라이다 고정 페어링, 예 fr09=ouster). + # sim 센서 드라이버 키(carla_lidar)는 라이다 정체성이 아니라 여기로 못 쓴다. + # 둘 다 없으면 None → launch 가 raw arg 폴백 (기존 동작 유지). + 'lidar': SD.get('lidar_id') or (P.get('sim_lidar') if sim else None), + 'vehicle_driver': vd_name, + 'sensor_driver': sd_name, + 'driver_includes': driver_includes, + 'adapter': None if spec is None else { + 'package': spec.package, + 'executable': spec.executable, + 'name': spec.executable, # 노드 이름 = 기존 유지(cmd_vel_to_ackermann / cmd_vel_to_tod) + 'params': adapter_params, + }, + 'sensor_bridge_params': sensor_bridge_params, + } diff --git a/src/vehicle_pkg/vehicle_pkg/pub_clock.py b/src/vehicle_pkg/vehicle_pkg/pub_clock.py new file mode 100755 index 0000000..76f0d51 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/pub_clock.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +import rclpy +from rclpy.node import Node +from rosgraph_msgs.msg import Clock +from builtin_interfaces.msg import Time + + +class SystemClockPublisher(Node): + def __init__(self): + super().__init__('system_clock_publisher') + + self.declare_parameter('publish_rate', 100.0) + + rate = self.get_parameter('publish_rate').value + period = 1.0 / rate + + self.pub = self.create_publisher(Clock, '/clock', 10) + self.timer = self.create_timer(period, self.publish_clock) + + self.get_logger().info(f'Publishing system time to /clock at {rate} Hz') + + def publish_clock(self): + now = self.get_clock().now().to_msg() + + msg = Clock() + msg.clock = Time() + msg.clock.sec = now.sec + msg.clock.nanosec = now.nanosec + + self.pub.publish(msg) + + +def main(args=None): + rclpy.init(args=args) + node = SystemClockPublisher() + + try: + rclpy.spin(node) + except KeyboardInterrupt: + pass + + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/pub_vehicle_config.py b/src/vehicle_pkg/vehicle_pkg/pub_vehicle_config.py new file mode 100755 index 0000000..a16a4f6 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/pub_vehicle_config.py @@ -0,0 +1,75 @@ + +import rclpy +from rclpy.node import Node +from rclpy.qos import QoSProfile, DurabilityPolicy, ReliabilityPolicy +from std_msgs.msg import String +import json +from vehicle_pkg.perception_arg import decode_perception + +class ConfigPublisher(Node): + def __init__(self): + super().__init__('pub_vehicle_config') + + self.declare_parameter('sim_mode', True) + self.declare_parameter('lidar', 'ouster') + self.declare_parameter('level', 'None') + self.declare_parameter('robot', 'fr09') + self.declare_parameter('perception', '[]') + + self.sim_mode = self.get_parameter('sim_mode').value + self.lidar = self.get_parameter('lidar').value + self.level = self.get_parameter('level').value + self.robot = self.get_parameter('robot').value + self.perception = decode_perception(self.get_parameter('perception').value) + + qos = QoSProfile( + depth=1, + durability=DurabilityPolicy.TRANSIENT_LOCAL, + reliability=ReliabilityPolicy.RELIABLE + ) + + self.sent = False + self.msg = None + + self.pub = self.create_publisher(String, '/vehicle_config', qos) + + if self.level == 'None': + self.create_subscription(String, '/map_config', self.config_cb, qos) + else: + self.msg = String(data=json.dumps({ + "sim_mode": self.sim_mode, + "robot": self.robot, + "lidar": self.lidar, + "level": self.level, + "perception": self.perception + })) + + # 약간 대기 후 1회 발행 + self.create_timer(1.0, self.publish_once) + + def config_cb(self, msg:String): + sub_msg = json.loads(msg.data) + pub_msg = String() + pub_msg.data = json.dumps({ + 'sim_mode': self.sim_mode, + 'robot': self.robot, + 'lidar': self.lidar, + 'level': sub_msg["level"], + 'perception': self.perception + }) + + self.pub.publish(pub_msg) + + def publish_once(self): + if self.msg is None: return + + if not self.sent: + self.pub.publish(self.msg) + self.get_logger().info("Published config once") + self.sent = True + +def main(): + rclpy.init() + node = ConfigPublisher() + rclpy.spin(node) + rclpy.shutdown() diff --git a/src/vehicle_pkg/vehicle_pkg/registry.py b/src/vehicle_pkg/vehicle_pkg/registry.py new file mode 100755 index 0000000..3848f67 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/registry.py @@ -0,0 +1,48 @@ +"""vehicle_pkg adapter / scan-adapter registry. + +플랫폼/드라이버 프로파일(YAML)이 선언한 어댑터 *이름*을, 실제로 어떤 ROS +executable 로 spawn 할지로만 매핑하는 plugin 테이블이다. + +중요(하네스 가드): 이 파일은 "어떤 platform/robot 이면 어떤 driver" 같은 *선택 +로직*을 담지 않는다. 선택은 platform_*.yaml 의 default/sim_*_driver 필드(데이터)가 +하고, 여기서는 그 데이터가 가리키는 어댑터 이름 → executable 만 조회한다. +(선택 source 는 항상 프로파일/launch arg — Layer 5(Rule) 침범 방지) + +Phase 1 Step 2: dormant. 아직 vehicle.launch.py 가 import 하지 않음. +Step 4 에서 launch 인터프리터가 이 테이블로 어댑터 노드를 spawn. +""" + +from dataclasses import dataclass + + +@dataclass(frozen=True) +class AdapterSpec: + """cmd_vel 어댑터 노드 1개의 spawn 정보.""" + package: str + executable: str + + +# 어댑터 이름 → 노드 executable. +# (vehicle_driver 프로파일의 `adapter` 필드가 키. setup.py entry_points 와 일치해야 함) +ADAPTER_REGISTRY = { + 'ackermann_carla': AdapterSpec('vehicle_pkg', 'cmd_vel_to_ackermann'), # sim (CARLA, AckermannDrive) + 'ackermann_tod': AdapterSpec('vehicle_pkg', 'cmd_vel_to_tod'), # yhs CAN 실차 + 'vesc': AdapterSpec('vehicle_pkg', 'cmd_vel_to_ackermann_stamped'), # F1TENTH 실차 (mux 입력 AckermannDriveStamped) + # 'differential': AdapterSpec('vehicle_pkg', 'cmd_vel_to_diff'), # 추가 예정 (dormant seam) +} + +# scan 어댑터 이름 → 처리 방식 (sensor_driver 프로파일의 `scan_adapter` 필드가 키) +# pointcloud_to_laserscan : /raw/lidar(PointCloud2) → /scan (perception2d 하류 노드가 변환) +# laserscan_passthrough : LaserScan native 센서를 /scan 으로 직결 (Step 4 추가 예정) +SCAN_ADAPTERS = ('pointcloud_to_laserscan', 'laserscan_passthrough') + + +def get_adapter(name): + """어댑터 이름으로 AdapterSpec 조회. 없으면 명확한 KeyError.""" + try: + return ADAPTER_REGISTRY[name] + except KeyError: + raise KeyError( + f"[registry] 알 수 없는 차량 어댑터 '{name}'. " + f"등록된 어댑터: {sorted(ADAPTER_REGISTRY)}" + ) diff --git a/src/vehicle_pkg/vehicle_pkg/sensor_bridge.py b/src/vehicle_pkg/vehicle_pkg/sensor_bridge.py new file mode 100755 index 0000000..0d6feb5 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/sensor_bridge.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 +# File: sensor_bridge.py +# Description: +# 센서 토픽 -> 공용 토픽 전환 브리지 노드 +# +# sim_mode=True (시뮬레이션) +# LiDAR: /carla/hero/lidar -> /raw/lidar (frame: os_lidar) +# IMU : /carla/hero/imu -> /raw/imu (frame: os_imu) +# +# sim_mode=False (실차) +# LiDAR: /sensing/lidar/top/pointcloud -> /raw/lidar (frame 유지 — /tf_static 사용) +# IMU : /sensing/imu/imu_data -> /raw/imu (frame 유지 — /tf_static 사용) + +import rclpy +from rclpy.node import Node +from rclpy.qos import QoSProfile, ReliabilityPolicy, HistoryPolicy +from rclpy.qos import qos_profile_sensor_data +from sensor_msgs.msg import PointCloud2, Imu +from std_msgs.msg import Float32 +from rosgraph_msgs.msg import Clock + + +class SensorBridge(Node): + def __init__(self): + super().__init__('sensor_bridge') + + # 파라미터 선언 (launch 파일에서 개별 덮어쓰기 가능) + self.declare_parameter('input_lidar_topic', '/carla/hero/lidar') + self.declare_parameter('input_imu_topic', '/carla/hero/imu') + self.declare_parameter('output_lidar_topic', '/raw/lidar') + self.declare_parameter('output_imu_topic', '/raw/imu') + self.declare_parameter('lidar_frame', 'os_lidar') + self.declare_parameter('imu_frame', 'os_imu') + self.declare_parameter('input_speed_topic', '/carla/hero/speedometer') + self.declare_parameter('output_speed_topic', '/raw/speed') + self.declare_parameter('robot', 'mkmini') + self.declare_parameter('sim_mode', 'true') + # 속도 피드백 메시지 종류 (sensor_driver 프로파일에서 주입; 기존 if robot== 대체) + # 'sim_float32' : Float32 (CARLA speedometer) + # 'yhs_chassis' : yhs ChassisInfoFb (gear 로 후진 부호) + # 'none' : 속도 입력 없음 (구독 안 함) + self.declare_parameter('speed_msg', 'none') + + lidar_in = self.get_parameter('input_lidar_topic').value + imu_in = self.get_parameter('input_imu_topic').value + lidar_out = self.get_parameter('output_lidar_topic').value + imu_out = self.get_parameter('output_imu_topic').value + self.lidar_frame = self.get_parameter('lidar_frame').value + self.imu_frame = self.get_parameter('imu_frame').value + speed_in = self.get_parameter('input_speed_topic').value + speed_out = self.get_parameter('output_speed_topic').value + self.robot = self.get_parameter('robot').value + self.sim_mode = self.get_parameter('sim_mode').value + self.speed_msg = self.get_parameter('speed_msg').value + + # 입력 센서 QoS: 시뮬은 Reliable, 실차 센서는 Best Effort + sub_qos = QoSProfile( + reliability=ReliabilityPolicy.RELIABLE if self.sim_mode else ReliabilityPolicy.BEST_EFFORT, + history=HistoryPolicy.KEEP_LAST, + depth=10, + ) + + # 출력 QoS: downstream(Nav2 등)이 Reliable을 기대하므로 항상 Reliable 고정 + pub_qos = QoSProfile( + reliability=ReliabilityPolicy.RELIABLE, + history=HistoryPolicy.KEEP_LAST, + depth=10, + ) + + # Publisher / Subscriber + self.lidar_pub = self.create_publisher(PointCloud2, lidar_out, pub_qos) + self.imu_pub = self.create_publisher(Imu, imu_out, pub_qos) + self.speed_pub = self.create_publisher(Float32, speed_out, pub_qos) + + self.create_subscription(PointCloud2, lidar_in, self.lidar_cb, qos_profile_sensor_data) + self.create_subscription(Imu, imu_in, self.imu_cb, qos_profile_sensor_data) + self.create_subscription(Clock, '/clock', self.clock_cb, pub_qos) + # 속도 입력 구독은 speed_msg 종류로 결정 (sensor_driver 프로파일이 주입). + # 'none' 이면 구독 안 함 (예: fr09 실차 — 과거 Autoware VelocityReport 잔재 제거됨). + if self.speed_msg == 'sim_float32': + self.create_subscription(Float32, speed_in, self.speed_cb, 50) + elif self.speed_msg == 'yhs_chassis': + # yhs 메시지는 드라이버 모듈 오버레이에서만 제공 (R2-9) + # non-mkmini 실행의 import 실패 방지 — 이 분기에서만 import + from yhs_can_interfaces.msg import ChassisInfoFb + self.create_subscription(ChassisInfoFb, speed_in, self.speed_cb, sub_qos) + + mode_str = 'simulation' if self.sim_mode == 'true' else 'real' + self.get_logger().info(f'SensorBridge started [{mode_str} mode {self.robot}]') + self.get_logger().info(f'sim_mode: {self.sim_mode}') + self.get_logger().info(f' LiDAR: {lidar_in} -> {lidar_out}') + self.get_logger().info(f' IMU : {imu_in} -> {imu_out}') + self.get_logger().info(f' SPEED: {speed_in} -> {speed_out}') + self.current_clock = None + self.odom_orientation = None + + def lidar_cb(self, msg: PointCloud2): + if self.lidar_frame: + msg.header.frame_id = self.lidar_frame + if self.current_clock: + msg.header.stamp = self.current_clock + self.lidar_pub.publish(msg) + + def imu_cb(self, msg: Imu): + if self.imu_frame: + msg.header.frame_id = self.imu_frame + if self.current_clock: + msg.header.stamp = self.current_clock + self.imu_pub.publish(msg) + + def speed_cb(self, msg): + out = Float32() + if self.speed_msg == 'sim_float32': + out.data = float(msg.data) + elif self.speed_msg == 'yhs_chassis': + if msg.ctrl_fb.ctrl_fb_gear == 2: + out.data = float(-msg.ctrl_fb.ctrl_fb_velocity) # 후진 + else: + out.data = float(msg.ctrl_fb.ctrl_fb_velocity) + self.speed_pub.publish(out) + + def clock_cb(self, msg: Clock): + self.current_clock = msg.clock + + +def main(args=None): + rclpy.init(args=args) + node = SensorBridge() + try: + rclpy.spin(node) + except KeyboardInterrupt: + pass + finally: + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/test.py b/src/vehicle_pkg/vehicle_pkg/test.py new file mode 100755 index 0000000..daab1fd --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/test.py @@ -0,0 +1,6 @@ +def main(): + print('Hi from vehicle_pkg.') + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/wasd_teleop.py b/src/vehicle_pkg/vehicle_pkg/wasd_teleop.py new file mode 100755 index 0000000..5aa2877 --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/wasd_teleop.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +# File: wasd_teleop.py +# Description: +# F1TENTH 키보드 수동주행 (전용 조이스틱 없음 → WASD). +# AckermannDriveStamped 를 ackermann_mux 의 joystick 입력('teleop', priority 100)에 직접 발행한다. +# teleop → ackermann_mux(joystick prio 100, nav 'drive' prio 10 보다 높음) → ackermann_cmd +# → ackermann_to_vesc → VESC (조향 서보 + 모터). +# cmd_vel→ackermann 자전거모델 변환(atan(L·ω/v))을 우회하므로, 정지 상태(speed=0)에서도 +# 조향각을 직접 지정 → 휠만 꺾인다. (변환노드는 Nav2 전용으로 남겨 무영향.) +# +# 조작 모델 (2026-06-22 개정 — 차처럼 조향 유지): +# w/s : 전진/후진 가속 (현재 조향각 유지, 누르는 동안 주행 / 떼면 hold_timeout 후 정지) +# a/d : 조향을 좌/우로 turn_step 만큼 꺾기 (정지 중에도 휠만 꺾임, 유지) +# space/x/k : 직진복귀 + 정지 +# q/z : 속도 +/-10% e/c : 조향 step(세기) +/-10% +# 조향각은 [-max_steering_angle, +max_steering_angle] 로 clamp. +# ※ 물리 조이스틱이 붙으면 joy_teleop 와 같은 'teleop' 토픽을 공유하므로 동시 사용 금지 +# (F1TENTH 엔 조이스틱이 없어 WASD 가 그 자리를 대신함). +import sys +import termios +import tty +import select +import threading +import time + +import rclpy +from rclpy.node import Node +from ackermann_msgs.msg import AckermannDriveStamped + +HELP = """ +[WASD 텔레옵 — F1TENTH] (이 터미널 창 포커스 필요) + w 전진 s 후진 (현재 조향각 그대로) + a 조향 왼쪽 d 조향 오른쪽 (휠만 꺾임, 유지 — 정지 중에도 동작) + space / x / k : 직진복귀 + 정지 + q / z : 속도 +/-10% e / c : 조향 step +/-10% + Ctrl-C : 종료 +* w/s 는 '누르고 있는 동안' 주행, 떼면 {hold:.1f}s 후 자동 정지(hold-to-drive). 조향은 유지. +* a/d 는 전진값을 넣지 않는다 (운전대처럼 휠만 꺾고, w 로 그 각도로 전진). +""" + + +def clamp(value: float, lower: float, upper: float) -> float: + return max(lower, min(upper, value)) + + +class WasdTeleop(Node): + def __init__(self): + super().__init__('wasd_teleop') + self.output_topic = self.declare_parameter('output_topic', 'teleop').value # mux joystick 입력 + self.frame_id = self.declare_parameter('frame_id', 'base_link').value + self.speed = float(self.declare_parameter('speed', 0.5).value) # m/s (w/s) + self.turn_step = float(self.declare_parameter('turn_step', 0.08).value) # rad, a/d 1회 조향 증분 + self.max_steering_angle = float(self.declare_parameter('max_steering_angle', 0.32).value) + self.rate = float(self.declare_parameter('publish_rate', 30.0).value) + self.hold_timeout = float(self.declare_parameter('hold_timeout', 0.5).value) + + self.pub = self.create_publisher(AckermannDriveStamped, self.output_topic, 10) + self._speed = 0.0 # 현재 주행 속도 (w/s, deadman 으로 자동 0) + self._steer = 0.0 # 현재 조향각 (a/d, 유지 — deadman 영향 없음) + self._last_drive = 0.0 # 마지막 w/s 입력 시각 + self._lock = threading.Lock() + self.create_timer(1.0 / self.rate, self._tick) + + def _tick(self): + with self._lock: + if (time.monotonic() - self._last_drive) > self.hold_timeout: + self._speed = 0.0 # 조향(self._steer)은 유지 + msg = AckermannDriveStamped() + msg.header.stamp = self.get_clock().now().to_msg() + msg.header.frame_id = self.frame_id + msg.drive.speed = self._speed + msg.drive.steering_angle = self._steer + msg.drive.steering_angle_velocity = 0.0 + self.pub.publish(msg) + + def drive(self, speed): + with self._lock: + self._speed = speed + self._last_drive = time.monotonic() + + def steer(self, delta): + with self._lock: + self._steer = clamp(self._steer + delta, -self.max_steering_angle, self.max_steering_angle) + + def stop_and_center(self): + with self._lock: + self._speed = 0.0 + self._steer = 0.0 + + def stop_now(self): + self.stop_and_center() + self._tick() + + +def main(): + rclpy.init() + node = WasdTeleop() + threading.Thread(target=rclpy.spin, args=(node,), daemon=True).start() + + out = sys.stdout + + def status(line): + out.write('\r' + line + ' \r\n') + out.flush() + + settings = termios.tcgetattr(sys.stdin) + out.write(HELP.format(hold=node.hold_timeout)) + status(f"speed={node.speed:.2f} m/s turn_step={node.turn_step:.3f} rad steer={node._steer:.3f} rad") + try: + tty.setraw(sys.stdin.fileno()) + while rclpy.ok(): + r, _, _ = select.select([sys.stdin], [], [], 0.1) + if not r: + continue + k = sys.stdin.read(1) + if k == '\x03': # Ctrl-C + break + elif k in ('w', 'W'): + node.drive(node.speed) + elif k in ('s', 'S'): + node.drive(-node.speed) + elif k in ('a', 'A'): + node.steer(node.turn_step) + status(f"steer={node._steer:.3f} rad") + elif k in ('d', 'D'): + node.steer(-node.turn_step) + status(f"steer={node._steer:.3f} rad") + elif k in (' ', 'x', 'X', 'k', 'K'): + node.stop_and_center() + status("정지 + 직진복귀") + elif k in ('q', 'Q'): + node.speed = round(node.speed * 1.1, 3) + status(f"speed={node.speed:.2f}") + elif k in ('z', 'Z'): + node.speed = round(node.speed * 0.9, 3) + status(f"speed={node.speed:.2f}") + elif k in ('e', 'E'): + node.turn_step = round(min(node.turn_step * 1.1, node.max_steering_angle), 4) + status(f"turn_step={node.turn_step:.3f}") + elif k in ('c', 'C'): + node.turn_step = round(node.turn_step * 0.9, 4) + status(f"turn_step={node.turn_step:.3f}") + except Exception as exc: # noqa: BLE001 + out.write(f"\r\n[wasd_teleop] error: {exc}\r\n") + finally: + termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings) + try: + node.stop_now() + except Exception: # noqa: BLE001 + pass + node.destroy_node() + rclpy.shutdown() + print("\n[wasd_teleop] 정지 후 종료.") + + +if __name__ == '__main__': + main() diff --git a/src/vehicle_pkg/vehicle_pkg/wasd_teleop_pg.py b/src/vehicle_pkg/vehicle_pkg/wasd_teleop_pg.py new file mode 100755 index 0000000..682c22a --- /dev/null +++ b/src/vehicle_pkg/vehicle_pkg/wasd_teleop_pg.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +# File: wasd_teleop_pg.py +# Description: +# F1TENTH 키보드 수동주행 (pygame 입력판 — 진짜 자동차처럼). +# 터미널(raw tty)판 wasd_teleop.py 와 달리 pygame.key.get_pressed() 로 매 프레임 +# 전체 키 상태를 읽으므로 (1) w+a 동시입력(조향 중 throttle 유지)과 +# (2) a/d 떼면 조향 자동 직진복귀(STEER_RETURN) 가 진짜로 된다. +# 입력 모델은 레포의 검증된 CARLA 텔레옵(slam2d_pkg/teleop_key.py) 방식을 이식. +# 발행: AckermannDriveStamped → 'teleop' (ackermann_mux joystick prio 100) +# → ackermann_to_vesc → VESC. cmd_vel→ackermann 변환 우회(Nav2 무영향). +# +# 조작: +# w/s (꾹) : 전진/후진 — a/d 로 조향하는 동안에도 throttle 유지 +# a/d (꾹) : 좌/우 조향, 떼면 자동 직진복귀 +# space : 비상정지 + 직진복귀 +# 창에 포커스가 있어야 키가 먹는다 (pygame 윈도우 클릭). +import math +import pygame + +import rclpy +from rclpy.node import Node +from ackermann_msgs.msg import AckermannDriveStamped + + +def clamp(v, lo, hi): + return max(lo, min(hi, v)) + + +def slew(curr, target, rate, dt): + step = rate * dt + if abs(target - curr) <= step: + return target + return curr + step * (1.0 if target > curr else -1.0) + + +class WasdTeleopPg(Node): + def __init__(self): + super().__init__('wasd_teleop_pg') + self.output_topic = self.declare_parameter('output_topic', 'teleop').value + self.frame_id = self.declare_parameter('frame_id', 'base_link').value + self.speed = float(self.declare_parameter('speed', 0.5).value) # m/s, w/s 목표속도 + self.max_steer = float(self.declare_parameter('max_steering_angle', 0.32).value) # rad + self.accel_rate = float(self.declare_parameter('accel_rate', 1.5).value) # m/s^2 (속도 변화율) + self.steer_rate = float(self.declare_parameter('steer_rate', 1.6).value) # rad/s (꺾는 속도) + self.steer_return = float(self.declare_parameter('steer_return', 2.4).value) # rad/s (복귀 속도) + self.pub = self.create_publisher(AckermannDriveStamped, self.output_topic, 10) + self._speed = 0.0 + self._steer = 0.0 + # idle_silent: 완전 idle(키 없음 + speed/steer 가 ~0 으로 정착)이면 발행을 멈춘다 → + # ackermann_mux 의 joystick 입력(prio 100, timeout 0.2s)이 만료돼 navigation(prio 10) + # 으로 자동 양보. 자율주행 중 WASD 창이 떠 있어도 nav 명령을 막지 않는 "수동 override" + # 동작이 된다. 발행을 멈추는 순간의 마지막 값은 항상 ~0 이라 VESC 가 hold 해도 안전(정지). + # 매핑 모드(nav 없음)에서도 키 떼면 0 으로 감속 후 silent → mux 만료 → 정지로 동일하게 안전. + self.idle_silent = bool(self.declare_parameter('idle_silent', True).value) + self.idle_eps = float(self.declare_parameter('idle_eps', 0.02).value) # m/s + self.idle_steer_eps = float(self.declare_parameter('idle_steer_eps', 0.01).value) # rad + + def publish(self): + msg = AckermannDriveStamped() + msg.header.stamp = self.get_clock().now().to_msg() + msg.header.frame_id = self.frame_id + msg.drive.speed = self._speed + msg.drive.steering_angle = self._steer + msg.drive.steering_angle_velocity = 0.0 + self.pub.publish(msg) + + +def main(): + rclpy.init() + node = WasdTeleopPg() + + pygame.init() + pygame.display.set_caption("F1TENTH WASD Teleop (pygame)") + screen = pygame.display.set_mode((460, 150)) + font = pygame.font.SysFont(None, 26) + clock = pygame.time.Clock() + + try: + while rclpy.ok(): + for ev in pygame.event.get(): + if ev.type == pygame.QUIT: + raise KeyboardInterrupt + if ev.type == pygame.KEYDOWN and ev.key == pygame.K_ESCAPE: + raise KeyboardInterrupt + + dt = max(1e-3, clock.tick(60) / 1000.0) + keys = pygame.key.get_pressed() + + fwd = keys[pygame.K_w] or keys[pygame.K_UP] + back = keys[pygame.K_s] or keys[pygame.K_DOWN] + left = keys[pygame.K_a] or keys[pygame.K_LEFT] + right = keys[pygame.K_d] or keys[pygame.K_RIGHT] + estop = keys[pygame.K_SPACE] + + # --- 속도: w/s 누르는 동안 목표속도, 둘 다 아니면 0 (slew) --- + if estop: + target_speed = 0.0 + elif fwd and not back: + target_speed = node.speed + elif back and not fwd: + target_speed = -node.speed + else: + target_speed = 0.0 + node._speed = slew(node._speed, target_speed, node.accel_rate, dt) + + # --- 조향: a/d 누르는 동안 좌/우 끝으로, 떼면 0 으로 자동복귀 --- + # 부호 관례: a(왼쪽)=+, d(오른쪽)=- (터미널판과 동일) + if estop: + node._steer = slew(node._steer, 0.0, node.steer_return, dt) + elif left and not right: + node._steer = slew(node._steer, node.max_steer, node.steer_rate, dt) + elif right and not left: + node._steer = slew(node._steer, -node.max_steer, node.steer_rate, dt) + else: + node._steer = slew(node._steer, 0.0, node.steer_return, dt) + + node._steer = clamp(node._steer, -node.max_steer, node.max_steer) + # idle 가 아니면(키 입력 또는 잔여 속도/조향) 발행. 완전 idle + idle_silent 면 발행 + # 중단 → mux joystick 만료 → nav 양보 (위 __init__ 주석 참고). + active = (fwd or back or left or right or estop + or abs(node._speed) > node.idle_eps + or abs(node._steer) > node.idle_steer_eps) + if active or not node.idle_silent: + node.publish() + + # --- HUD --- + screen.fill((18, 18, 22)) + lines = [ + f"speed: {node._speed:+.2f} m/s steer: {math.degrees(node._steer):+5.1f} deg", + "w/s: drive(hold) a/d: steer(hold, release=center)", + "space: e-stop+center ESC: quit", + ] + for i, t in enumerate(lines): + screen.blit(font.render(t, True, (220, 220, 220)), (12, 16 + i * 38)) + pygame.display.flip() + + rclpy.spin_once(node, timeout_sec=0.0) + except KeyboardInterrupt: + pass + finally: + node._speed = 0.0 + node._steer = 0.0 + node.publish() + pygame.quit() + node.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main()