Skip to content

Commit

Permalink
Merge branch 'main' into docs/contribution-guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mojomex authored Oct 3, 2024
2 parents f208a97 + 668c8f7 commit 5402501
Show file tree
Hide file tree
Showing 148 changed files with 3,049 additions and 3,435 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
# Visual Studio Code
.vscode/
*.code-workspace
*.env

# colcon
build/
install/
log/

# Clangd
.cache/

# profiling
profiling_output/

# Python
srv/_*.py
*.pyc
__pycache__

# Ignore generated docs
*.dox
Expand Down
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ repos:
rev: 1.6.1
hooks:
- id: cpplint
args: [--quiet]
# runtime/arrays uses the name of the variable to determine const-ness.
# This does not play well with our naming conventions
args: [--quiet, --filter=-runtime/arrays]
exclude: .cu

exclude: .svg
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Nebula works with ROS 2 and is the recommended sensor driver for the [Autoware](
We recommend you get started with the [Nebula Documention](https://tier4.github.io/nebula/).
Here you will find information about the background of the project, how to install and use with ROS 2, and also how to add new sensors to the Nebula driver.

- [About Nebula](https://tier4.github.io/nebula/about)
- [About Nebula](https://tier4.github.io/nebula)
- [Design](https://tier4.github.io/nebula/design)
- [Supported Sensors](https://tier4.github.io/nebula/supported_sensors)
- [Installation](https://tier4.github.io/nebula/installation)
Expand All @@ -32,24 +32,18 @@ Nebula builds with ROS 2 Galactic and Humble.
> **Note**
>
> Boost version 1.74.0 or later is required. A manual install may be required in Ubuntu versions earlier than 22.04.
>
> **Note**
>
> A [TCP enabled version of ROS' Transport Driver](https://github.com/mojomex/transport_drivers/tree/mutable-buffer-in-udp-callback) is required to use Nebula.
> It is installed automatically into your workspace using the below commands. However, if you already have ROS transport driver binaries installed, you will have to uninstall them to avoid conflicts (replace `humble` with your ROS distribution):
> `sudo apt remove ros-humble-udp-driver ros-humble-io-context`
To build Nebula run the following commands in your workspace:

```bash
# In workspace
mkdir src
git clone https://github.com/tier4/nebula.git src
git clone https://github.com/tier4/nebula.git
cd nebula
# Import dependencies
vcs import src < src/build_depends.repos
rosdep install --from-paths src --ignore-src -y -r
vcs import < build_depends.repos
rosdep install --from-paths . --ignore-src -y -r
# Build Nebula
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1
```

To launch Nebula as a ROS 2 node with default parameters for your sensor model:
Expand Down
16 changes: 5 additions & 11 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,18 @@ Please see the [ROS 2 documentation](https://docs.ros.org/en/humble/index.html)
> **Note**
>
> Boost version 1.74.0 or later is required. A manual install may be required in Ubuntu versions earlier than 22.04.
>
> **Note**
>
> A [TCP enabled version of ROS' Transport Driver](https://github.com/mojomex/transport_drivers/tree/mutable-buffer-in-udp-callback) is required to use Nebula.
> It is installed automatically into your workspace using the below commands. However, if you already have ROS transport driver binaries installed, you will have to uninstall them to avoid conflicts (replace `humble` with your ROS distribution):
> `sudo apt remove ros-humble-udp-driver ros-humble-io-context`
To build Nebula run the following commands in your workspace:

```bash
# In workspace
mkdir src
git clone https://github.com/tier4/nebula.git src
git clone https://github.com/tier4/nebula.git
cd nebula
# Import dependencies
vcs import src < src/build_depends.repos
rosdep install --from-paths src --ignore-src -y -r
vcs import < build_depends.repos
rosdep install --from-paths . --ignore-src -y -r
# Build Nebula
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1
```

## Testing your build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,64 +216,64 @@ using boost::endian::big_uint16_buf_t;
using boost::endian::big_uint32_buf_t;
using boost::endian::big_uint64_buf_t;

constexpr int CONFIGURATION_SERVICE_ID = 0;
constexpr int CONFIGURATION_METHOD_ID = 390;
constexpr int CONFIGURATION_PAYLOAD_LENGTH = 56;
constexpr int CONFIGURATION_UDP_LENGTH = 64;
constexpr int configuration_service_id = 0;
constexpr int configuration_method_id = 390;
constexpr int configuration_payload_length = 56;
constexpr int configuration_udp_length = 64;

constexpr int DETECTION_LIST_METHOD_ID = 336;
constexpr int OBJECT_LIST_METHOD_ID = 329;
constexpr int SENSOR_STATUS_METHOD_ID = 380;
constexpr int FILTER_STATUS_METHOD_ID = 396;
constexpr int detection_list_method_id = 336;
constexpr int object_list_method_id = 329;
constexpr int sensor_status_method_id = 380;
constexpr int filter_status_method_id = 396;

constexpr int DETECTION_LIST_UDP_PAYLOAD = 35336;
constexpr int OBJECT_LIST_UDP_PAYLOAD = 9401;
constexpr int SENSOR_STATUS_UDP_PAYLOAD = 84;
constexpr int FILTER_STATUS_UDP_PAYLOAD = 330;
constexpr int detection_list_udp_payload = 35336;
constexpr int object_list_udp_payload = 9401;
constexpr int sensor_status_udp_payload = 84;
constexpr int filter_status_udp_payload = 330;

constexpr int DETECTION_LIST_PDU_LENGTH = 35328;
constexpr int OBJECT_LIST_PDU_LENGTH = 9393;
constexpr int SENSOR_STATUS_PDU_LENGTH = 76;
constexpr int FILTER_STATUS_PDU_LENGTH = 322;
constexpr int detection_list_pdu_length = 35328;
constexpr int object_list_pdu_length = 9393;
constexpr int sensor_status_pdu_length = 76;
constexpr int filter_status_pdu_length = 322;

constexpr int DETECTION_FILTER_PROPERTIES_NUM = 7;
constexpr int OBJECT_FILTER_PROPERTIES_NUM = 24;
constexpr int MAX_DETECTIONS = 800;
constexpr int MAX_OBJECTS = 50;
constexpr int detection_filter_properties_num = 7;
constexpr int object_filter_properties_num = 24;
constexpr int max_detections = 800;
constexpr int max_objects = 50;

constexpr int SYNC_OK = 1;
constexpr int NEVER_SYNC = 2;
constexpr int SYNC_LOST = 3;
constexpr int sync_ok = 1;
constexpr int never_sync = 2;
constexpr int sync_lost = 3;

constexpr int PLUG_RIGHT = 0;
constexpr int PLUG_LEFT = 1;
constexpr int plug_right = 0;
constexpr int plug_left = 1;

constexpr int FREQUENCY_SLOT_LOW = 0;
constexpr int FREQUENCY_SLOT_MID = 1;
constexpr int FREQUENCY_SLOT_HIGH = 2;
constexpr int frequency_slot_low = 0;
constexpr int frequency_slot_mid = 1;
constexpr int frequency_slot_high = 2;

constexpr int HCC_WORLDWIDE = 1;
constexpr int HCC_JAPAN = 2;
constexpr int hcc_worldwide = 1;
constexpr int hcc_japan = 2;

constexpr int POWERSAVE_STANDSTILL_OFF = 0;
constexpr int POWERSAVE_STANDSTILL_ON = 1;
constexpr int powersave_standstill_off = 0;
constexpr int powersave_standstill_on = 1;

constexpr int VDY_OK = 0;
constexpr int VDY_NOTOK = 1;
constexpr int vdy_ok = 0;
constexpr int vdy_notok = 1;

constexpr int STATE_INIT = 0;
constexpr int STATE_OK = 1;
constexpr int STATE_INVALID = 2;
constexpr int state_init = 0;
constexpr int state_ok = 1;
constexpr int state_invalid = 2;

constexpr int BLOCKAGE_STATUS_BLIND = 0;
constexpr int BLOCKAGE_STATUS_HIGH = 1;
constexpr int BLOCKAGE_STATUS_MID = 2;
constexpr int BLOCKAGE_STATUS_LOW = 3;
constexpr int BLOCKAGE_STATUS_NONE = 4;
constexpr int blockage_status_blind = 0;
constexpr int blockage_status_high = 1;
constexpr int blockage_status_mid = 2;
constexpr int blockage_status_low = 3;
constexpr int blockage_status_none = 4;

constexpr int BLOCKAGE_TEST_FAILED = 0;
constexpr int BLOCKAGE_TEST_PASSED = 1;
constexpr int BLOCKAGE_TEST_ONGOING = 2;
constexpr int blockage_test_failed = 0;
constexpr int blockage_test_passed = 1;
constexpr int blockage_test_ongoing = 2;

#pragma pack(push, 1)

Expand Down Expand Up @@ -352,7 +352,7 @@ struct DetectionListPacket
big_float32_buf_t origin_yaw{};
big_float32_buf_t origin_yaw_std{};
uint8_t list_invalid_flags{};
DetectionPacket detections[MAX_DETECTIONS];
DetectionPacket detections[max_detections];
big_float32_buf_t list_rad_vel_domain_min{};
big_float32_buf_t list_rad_vel_domain_max{};
big_uint32_buf_t number_of_detections{};
Expand Down Expand Up @@ -439,7 +439,7 @@ struct ObjectListPacket
big_uint32_buf_t event_data_qualifier{};
uint8_t extended_qualifier{};
uint8_t number_of_objects{};
ObjectPacket objects[MAX_OBJECTS];
ObjectPacket objects[max_objects];
};

struct StatusConfigurationPacket
Expand Down Expand Up @@ -573,8 +573,8 @@ struct FilterStatusPacket
uint8_t filter_configuration_counter{};
uint8_t detection_sort_index{};
uint8_t object_sort_index{};
FilterStatusEntryPacket detection_filters[DETECTION_FILTER_PROPERTIES_NUM];
FilterStatusEntryPacket object_filters[OBJECT_FILTER_PROPERTIES_NUM];
FilterStatusEntryPacket detection_filters[detection_filter_properties_num];
FilterStatusEntryPacket object_filters[object_filter_properties_num];
};

#pragma pack(pop)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,49 +64,49 @@ using boost::endian::big_uint32_buf_t;
using boost::endian::big_uint64_buf_t;

// CAN MSG IDS
constexpr int RDI_NEAR_HEADER_CAN_MESSAGE_ID = 900;
constexpr int RDI_NEAR_ELEMENT_CAN_MESSAGE_ID = 901;
constexpr int RDI_HRR_HEADER_CAN_MESSAGE_ID = 1100;
constexpr int RDI_HRR_ELEMENT_CAN_MESSAGE_ID = 1101;
constexpr int OBJECT_HEADER_CAN_MESSAGE_ID = 1200;
constexpr int OBJECT_CAN_MESSAGE_ID = 1201;
constexpr int CRC_LIST_CAN_MESSAGE_ID = 800;
constexpr int STATUS_CAN_MESSAGE_ID = 700;
constexpr int SYNC_FOLLOW_UP_CAN_MESSAGE_ID = 53;
constexpr int VEH_DYN_CAN_MESSAGE_ID = 600;
constexpr int SENSOR_CONFIG_CAN_MESSAGE_ID = 601;
constexpr int rdi_near_header_can_message_id = 900;
constexpr int rdi_near_element_can_message_id = 901;
constexpr int rdi_hrr_header_can_message_id = 1100;
constexpr int rdi_hrr_element_can_message_id = 1101;
constexpr int object_header_can_message_id = 1200;
constexpr int object_can_message_id = 1201;
constexpr int crc_list_can_message_id = 800;
constexpr int status_can_message_id = 700;
constexpr int sync_follow_up_can_message_id = 53;
constexpr int veh_dyn_can_message_id = 600;
constexpr int sensor_config_can_message_id = 601;

// CRC IDS
constexpr int NEAR_CRC_ID = 0;
constexpr int HRR_CRC_ID = 1;
constexpr int OBJECT_CRC_ID = 2;
constexpr int TIME_DOMAIN_ID =
constexpr int near_crc_id = 0;
constexpr int hrr_crc_id = 1;
constexpr int object_crc_id = 2;
constexpr int time_domain_id =
0; // For details, please refer to AUTOSAR's "Time Synchronization over CAN" document

constexpr int RDI_NEAR_HEADER_PACKET_SIZE = 32;
constexpr int RDI_NEAR_ELEMENT_PACKET_SIZE = 64;
constexpr int RDI_HRR_HEADER_PACKET_SIZE = 32;
constexpr int RDI_HRR_ELEMENT_PACKET_SIZE = 64;
constexpr int OBJECT_HEADER_PACKET_SIZE = 32;
constexpr int OBJECT_PACKET_SIZE = 64;
constexpr int CRC_LIST_PACKET_SIZE = 4;
constexpr int STATUS_PACKET_SIZE = 64;
constexpr int SYNC_FOLLOW_UP_CAN_PACKET_SIZE = 8;
constexpr int VEH_DYN_CAN_PACKET_SIZE = 8;
constexpr int CONFIGURATION_PACKET_SIZE = 16;

constexpr int RDI_NEAR_PACKET_NUM = 50;
constexpr int RDI_HRR_PACKET_NUM = 20;
constexpr int OBJECT_PACKET_NUM = 20;

constexpr int FRAGMENTS_PER_DETECTION_PACKET = 10;
constexpr int FRAGMENTS_PER_OBJECT_PACKET = 2;
constexpr int DETECTION_FRAGMENT_SIZE = 6;
constexpr int OBJECT_FRAGMENT_SIZE = 31;

constexpr int MAX_RDI_NEAR_DETECTIONS = RDI_NEAR_PACKET_NUM * FRAGMENTS_PER_DETECTION_PACKET;
constexpr int MAX_RDI_HRR_DETECTIONS = RDI_HRR_PACKET_NUM * FRAGMENTS_PER_DETECTION_PACKET;
constexpr int MAX_OBJECTS = OBJECT_PACKET_NUM * FRAGMENTS_PER_OBJECT_PACKET;
constexpr int rdi_near_header_packet_size = 32;
constexpr int rdi_near_element_packet_size = 64;
constexpr int rdi_hrr_header_packet_size = 32;
constexpr int rdi_hrr_element_packet_size = 64;
constexpr int object_header_packet_size = 32;
constexpr int object_packet_size = 64;
constexpr int crc_list_packet_size = 4;
constexpr int status_packet_size = 64;
constexpr int sync_follow_up_can_packet_size = 8;
constexpr int veh_dyn_can_packet_size = 8;
constexpr int configuration_packet_size = 16;

constexpr int rdi_near_packet_num = 50;
constexpr int rdi_hrr_packet_num = 20;
constexpr int object_packet_num = 20;

constexpr int fragments_per_detection_packet = 10;
constexpr int fragments_per_object_packet = 2;
constexpr int detection_fragment_size = 6;
constexpr int object_fragment_size = 31;

constexpr int max_rdi_near_detections = rdi_near_packet_num * fragments_per_detection_packet;
constexpr int max_rdi_hrr_detections = rdi_hrr_packet_num * fragments_per_detection_packet;
constexpr int max_objects = object_packet_num * fragments_per_object_packet;

#pragma pack(push, 1)

Expand Down Expand Up @@ -162,12 +162,12 @@ struct ScanHeaderPacket

struct DetectionFragmentPacket
{
uint8_t data[DETECTION_FRAGMENT_SIZE];
uint8_t data[detection_fragment_size];
};

struct DetectionPacket
{
DetectionFragmentPacket fragments[FRAGMENTS_PER_DETECTION_PACKET]; // 0 - 59
DetectionFragmentPacket fragments[fragments_per_detection_packet]; // 0 - 59
uint8_t reserved0; // 60
uint8_t reserved1; // 61
uint8_t u_message_counter; // 62
Expand All @@ -192,12 +192,12 @@ struct ObjectHeaderPacket

struct ObjectFragmentPacket
{
uint8_t data[OBJECT_FRAGMENT_SIZE];
uint8_t data[object_fragment_size];
};

struct ObjectPacket
{
ObjectFragmentPacket fragments[FRAGMENTS_PER_OBJECT_PACKET]; // 0 - 61
ObjectFragmentPacket fragments[fragments_per_object_packet]; // 0 - 61
uint8_t u_message_counter; // 62
uint8_t u_sequence_counter; // 63
};
Expand Down
Loading

0 comments on commit 5402501

Please sign in to comment.