forked from tier4/nebula
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into docs-parameters
- Loading branch information
Showing
69 changed files
with
1,312 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
"block_id", | ||
"Bpearl", | ||
"calib", | ||
"centi", | ||
"ddeg", | ||
"DHAVE", | ||
"Difop", | ||
"extrinsics", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
|
||
# API Reference | ||
|
||
Nebula is divided into several modules: | ||
|
||
- Common, for type definitions and utilities | ||
- Decoders, for converting raw packets into pointclouds and performing correction and filtering | ||
- HW Interfaces, for hardware protocols and socket implementations | ||
- ROS Wrappers, for ROS launch, parameter handling, data publishing and diagnostics | ||
- **Common**, for type definitions and utilities | ||
- **Decoders**, for converting raw packets into pointclouds and performing correction and filtering | ||
- **HW interfaces**, for hardware protocols and socket implementations | ||
- **ROS wrappers**, for ROS launch, parameter handling, data publishing and diagnostics | ||
|
||
For API details, see the navigation items on this page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>nebula_common</name> | ||
<version>0.1.0</version> | ||
<version>0.2.0</version> | ||
<description>Nebula Common Libraries and headers</description> | ||
<maintainer email="[email protected]">MAP IV</maintainer> | ||
|
||
|
50 changes: 50 additions & 0 deletions
50
nebula_decoders/include/nebula_decoders/nebula_decoders_common/angles.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2024 TIER IV, 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. | ||
|
||
#pragma once | ||
|
||
#include <cmath> | ||
namespace nebula::drivers | ||
{ | ||
|
||
/** | ||
* @brief Tests if `angle` is in the region of the circle defined by `start_angle` and `end_angle`. | ||
* Notably, `end_angle` can be smaller than `start_angle`, in which case the region passes over the | ||
* 360/0 deg bound. This function is unit-independent (but all angles have to have the same unit), | ||
* so degrees, radians, and arbitrary scale factors can be used. | ||
*/ | ||
template <typename T> | ||
bool angle_is_between( | ||
T start_angle, T end_angle, T angle, bool start_inclusive = true, bool end_inclusive = true) | ||
{ | ||
if (!start_inclusive && angle == start_angle) return false; | ||
if (!end_inclusive && angle == end_angle) return false; | ||
|
||
return (start_angle <= angle && angle <= end_angle) || | ||
((end_angle < start_angle) && (angle <= end_angle || start_angle <= angle)); | ||
} | ||
|
||
/** | ||
* @brief Normalizes an angle to the interval [0; max_angle]. This function is unit-independent. | ||
* `max_angle` is 360 for degrees, 2 * M_PI for radians, and the corresponding scaled value for | ||
* scaled units such as centi-degrees (36000). | ||
*/ | ||
template <typename T> | ||
T normalize_angle(T angle, T max_angle) | ||
{ | ||
T factor = std::floor((1.0 * angle) / max_angle); | ||
return angle - (factor * max_angle); | ||
} | ||
|
||
} // namespace nebula::drivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.