Skip to content

Commit

Permalink
Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' int…
Browse files Browse the repository at this point in the history
…o RJD-1057-traffic-lights-tests
  • Loading branch information
dmoszynski authored Nov 6, 2024
2 parents c1a4a6f + 009e082 commit 215a588
Show file tree
Hide file tree
Showing 129 changed files with 1,411 additions and 505 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/Docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ jobs:
strategy:
matrix:
rosdistro: [humble]
arch: [amd64]
# Build test for arm64 CPU is broken.
# This is a temporary solution and will be repaired in the future.
# See also https://github.com/tier4/scenario_simulator_v2/pull/1295
# arch: [amd64, arm64]
arch: [amd64, arm64]

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand All @@ -51,6 +48,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Qemu Setup
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
docker buildx inspect --bootstrap
- name: Build (${{ matrix.arch }})
if: github.event_name == 'pull_request'
uses: docker/bake-action@v3
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,11 @@ RUN vcs import external < dependency_${ROS_DISTRO}.repos
WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src
RUN --mount=type=cache,id=apt-cache-arm64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-arm64,target=/var/lib/apt,sharing=locked \
source /opt/ros/${ROS_DISTRO}/setup.bash \
&& apt-get update \
&& rosdep install -iy --from-paths . --rosdistro ${ROS_DISTRO}
bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && apt-get update && rosdep install -iy --from-paths . --rosdistro ${ROS_DISTRO}"

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws

RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_CPP_MOCK_SCENARIOS=ON
RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_CPP_MOCK_SCENARIOS=ON"
COPY ./docker-entrypoint.sh /
RUN chmod a+x /docker-entrypoint.sh

Expand Down
32 changes: 32 additions & 0 deletions common/math/arithmetic/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ Changelog for package arithmetic
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

4.3.21 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Contributors: Grzegorz Maj, Masaya Kataoka

4.3.20 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1335/requestSpeedChange
* Contributors: Grzegorz Maj

4.3.19 (2024-10-30)
-------------------

4.3.18 (2024-10-18)
-------------------
* Merge branch 'master' into feature/json/boost-json
* Merge branch 'master' into feature/json/boost-json
* Merge remote-tracking branch 'origin/master' into feature/json/boost-json
* Contributors: Kotaro Yoshimoto, f0reachARR, ぐるぐる

4.3.17 (2024-10-17)
-------------------
* Merge branch 'master' into fix/remove_warnings_from_sonarcloud
* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into fix/remove_warnings_from_sonarcloud
* Contributors: Masaya Kataoka

4.3.16 (2024-10-15)
-------------------

4.3.15 (2024-10-10)
-------------------
* Merge branch 'master' into feature/faster-compilation
Expand Down
2 changes: 1 addition & 1 deletion common/math/arithmetic/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>arithmetic</name>
<version>4.3.15</version>
<version>4.3.21</version>
<description>arithmetic library for scenario_simulator_v2</description>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
<license>Apache License 2.0</license>
Expand Down
40 changes: 40 additions & 0 deletions common/math/geometry/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,46 @@ Changelog for package geometry
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

4.3.21 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Contributors: Grzegorz Maj, Masaya Kataoka

4.3.20 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1335/requestSpeedChange
* Contributors: Grzegorz Maj

4.3.19 (2024-10-30)
-------------------

4.3.18 (2024-10-18)
-------------------
* Merge branch 'master' into feature/json/boost-json
* Merge branch 'master' into feature/json/boost-json
* Merge remote-tracking branch 'origin/master' into feature/json/boost-json
* Contributors: Kotaro Yoshimoto, f0reachARR, ぐるぐる

4.3.17 (2024-10-17)
-------------------
* Merge pull request `#1417 <https://github.com/tier4/scenario_simulator_v2/issues/1417>`_ from tier4/fix/remove_warnings_from_sonarcloud
Fix/remove warnings from sonarcloud
* Merge branch 'master' into fix/remove_warnings_from_sonarcloud
* fix warning "There is a intentionality issues on this line, the code is not efficient"
* fix some warnings
* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into fix/remove_warnings_from_sonarcloud
* remove const
* add const to the curve parameters and use const reference in constructor
* remove typedef and remove variable which is used just once.
* remove unused operator and typedef
* Contributors: Masaya Kataoka, Tatsuya Yamasaki

4.3.16 (2024-10-15)
-------------------

4.3.15 (2024-10-10)
-------------------
* Merge pull request `#1361 <https://github.com/tier4/scenario_simulator_v2/issues/1361>`_ from tier4/fix/RJD-1296-fix-random001-ego-issue
Expand Down
4 changes: 2 additions & 2 deletions common/math/geometry/include/geometry/bounding_box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace math
namespace geometry
{

typedef boost::geometry::model::d2::point_xy<double> boost_point;
typedef boost::geometry::model::polygon<boost_point> boost_polygon;
using boost_point = boost::geometry::model::d2::point_xy<double>;
using boost_polygon = boost::geometry::model::polygon<boost_point>;

struct DistancesFromCenterToEdge
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class LineSegment
LineSegment(
const geometry_msgs::msg::Point & start_point, const geometry_msgs::msg::Vector3 & vec,
double length);
~LineSegment();
LineSegment & operator=(const LineSegment &);

auto isIntersect2D(const geometry_msgs::msg::Point & point) const -> bool;
auto isIntersect2D(const LineSegment & line) const -> bool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class HermiteCurve

public:
HermiteCurve(
geometry_msgs::msg::Pose start_pose, geometry_msgs::msg::Pose goal_pose,
geometry_msgs::msg::Vector3 start_vec, geometry_msgs::msg::Vector3 goal_vec);
const geometry_msgs::msg::Pose & start_pose, const geometry_msgs::msg::Pose & goal_pose,
const geometry_msgs::msg::Vector3 & start_vec, const geometry_msgs::msg::Vector3 & goal_vec);
HermiteCurve(
double ax, double bx, double cx, double dx, double ay, double by, double cy, double dy,
double az, double bz, double cz, double dz);
Expand Down
2 changes: 1 addition & 1 deletion common/math/geometry/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>geometry</name>
<version>4.3.15</version>
<version>4.3.21</version>
<description>geometry math library for scenario_simulator_v2 application</description>
<maintainer email="[email protected]">Masaya Kataoka</maintainer>
<license>Apache License 2.0</license>
Expand Down
4 changes: 2 additions & 2 deletions common/math/geometry/src/distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ double getDistance2D(
const std::vector<geometry_msgs::msg::Point> & polygon0,
const std::vector<geometry_msgs::msg::Point> & polygon1)
{
typedef boost::geometry::model::d2::point_xy<double> boost_point;
typedef boost::geometry::model::polygon<boost_point> boost_polygon;
using boost_point = boost::geometry::model::d2::point_xy<double>;
using boost_polygon = boost::geometry::model::polygon<boost_point>;
boost_polygon poly0;
for (const auto & point : polygon0) {
boost::geometry::exterior_ring(poly0).push_back(boost_point(point.x, point.y));
Expand Down
21 changes: 10 additions & 11 deletions common/math/geometry/src/intersection/collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@ namespace math
{
namespace geometry
{
using boost_point = boost::geometry::model::d2::point_xy<double>;
using boost_polygon = boost::geometry::model::polygon<boost_point>;

bool checkCollision2D(
geometry_msgs::msg::Pose pose0, traffic_simulator_msgs::msg::BoundingBox bbox0,
geometry_msgs::msg::Pose pose1, traffic_simulator_msgs::msg::BoundingBox bbox1)
{
double z_diff_pose =
std::abs((pose0.position.z + bbox0.center.z) - (pose1.position.z + bbox1.center.z));
if (z_diff_pose > (std::abs(bbox0.dimensions.z + bbox1.dimensions.z) * 0.5)) {
if (
std::abs((pose0.position.z + bbox0.center.z) - (pose1.position.z + bbox1.center.z)) >
(std::abs(bbox0.dimensions.z + bbox1.dimensions.z) * 0.5)) {
return false;
}
namespace bg = boost::geometry;
typedef bg::model::d2::point_xy<double> bg_point;
const bg::model::polygon<bg_point> poly0 = math::geometry::toPolygon2D(pose0, bbox0);
const bg::model::polygon<bg_point> poly1 = math::geometry::toPolygon2D(pose1, bbox1);
if (bg::intersects(poly0, poly1)) {
const boost_polygon poly0 = math::geometry::toPolygon2D(pose0, bbox0);
const boost_polygon poly1 = math::geometry::toPolygon2D(pose1, bbox1);
if (boost::geometry::intersects(poly0, poly1)) {
return true;
}
if (bg::disjoint(poly0, poly1)) {
if (boost::geometry::disjoint(poly0, poly1)) {
return false;
}
return true;
Expand All @@ -51,8 +52,6 @@ bool checkCollision2D(
bool contains(
const std::vector<geometry_msgs::msg::Point> & polygon, const geometry_msgs::msg::Point & point)
{
typedef boost::geometry::model::d2::point_xy<double> boost_point;
typedef boost::geometry::model::polygon<boost_point> boost_polygon;
boost_polygon poly;
for (const auto & p : polygon) {
boost::geometry::exterior_ring(poly).push_back(boost_point(p.x, p.y));
Expand Down
4 changes: 0 additions & 4 deletions common/math/geometry/src/polygon/line_segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ LineSegment::LineSegment(
{
}

LineSegment::~LineSegment() {}

/**
* @brief Get point on the line segment from s value.
* @param s Normalized s value in coordinate along line segment.
Expand Down Expand Up @@ -301,8 +299,6 @@ auto LineSegment::denormalize(const double s) const -> double
}
}

LineSegment & LineSegment::operator=(const LineSegment &) { return *this; }

/**
* @brief Get the line segments from points.
* @param points Points you want to build line segments.
Expand Down
4 changes: 2 additions & 2 deletions common/math/geometry/src/polygon/polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace geometry
std::vector<geometry_msgs::msg::Point> get2DConvexHull(
const std::vector<geometry_msgs::msg::Point> & points)
{
typedef boost::geometry::model::d2::point_xy<double> boost_point;
typedef boost::geometry::model::polygon<boost_point> boost_polygon;
using boost_point = boost::geometry::model::d2::point_xy<double>;
using boost_polygon = boost::geometry::model::polygon<boost_point>;
boost_polygon poly;
for (const auto & p : points) {
boost::geometry::exterior_ring(poly).push_back(boost_point(p.x, p.y));
Expand Down
6 changes: 3 additions & 3 deletions common/math/geometry/src/spline/catmull_rom_spline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ CatmullRomSpline::CatmullRomSpline(const std::vector<geometry_msgs::msg::Point>
bz = bz * 0.5;
cz = cz * 0.5;
dz = dz * 0.5;
curves_.emplace_back(HermiteCurve(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz));
curves_.emplace_back(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz);
} else if (i == (n - 1)) {
double ax = 0;
double bx = control_points[i - 1].x - 2 * control_points[i].x + control_points[i + 1].x;
Expand All @@ -197,7 +197,7 @@ CatmullRomSpline::CatmullRomSpline(const std::vector<geometry_msgs::msg::Point>
bz = bz * 0.5;
cz = cz * 0.5;
dz = dz * 0.5;
curves_.emplace_back(HermiteCurve(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz));
curves_.emplace_back(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz);
} else {
double ax = -1 * control_points[i - 1].x + 3 * control_points[i].x -
3 * control_points[i + 1].x + control_points[i + 2].x;
Expand Down Expand Up @@ -229,7 +229,7 @@ CatmullRomSpline::CatmullRomSpline(const std::vector<geometry_msgs::msg::Point>
bz = bz * 0.5;
cz = cz * 0.5;
dz = dz * 0.5;
curves_.emplace_back(HermiteCurve(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz));
curves_.emplace_back(ax, bx, cx, dx, ay, by, cy, dy, az, bz, cz, dz);
}
}
for (const auto & curve : curves_) {
Expand Down
32 changes: 15 additions & 17 deletions common/math/geometry/src/spline/hermite_curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,22 @@ HermiteCurve::HermiteCurve(
}

HermiteCurve::HermiteCurve(
geometry_msgs::msg::Pose start_pose, geometry_msgs::msg::Pose goal_pose,
geometry_msgs::msg::Vector3 start_vec, geometry_msgs::msg::Vector3 goal_vec)
const geometry_msgs::msg::Pose & start_pose, const geometry_msgs::msg::Pose & goal_pose,
const geometry_msgs::msg::Vector3 & start_vec, const geometry_msgs::msg::Vector3 & goal_vec)
: ax_(2 * start_pose.position.x - 2 * goal_pose.position.x + start_vec.x + goal_vec.x),
bx_(-3 * start_pose.position.x + 3 * goal_pose.position.x - 2 * start_vec.x - goal_vec.x),
cx_(start_vec.x),
dx_(start_pose.position.x),
ay_(2 * start_pose.position.y - 2 * goal_pose.position.y + start_vec.y + goal_vec.y),
by_(-3 * start_pose.position.y + 3 * goal_pose.position.y - 2 * start_vec.y - goal_vec.y),
cy_(start_vec.y),
dy_(start_pose.position.y),
az_(2 * start_pose.position.z - 2 * goal_pose.position.z + start_vec.z + goal_vec.z),
bz_(-3 * start_pose.position.z + 3 * goal_pose.position.z - 2 * start_vec.z - goal_vec.z),
cz_(start_vec.z),
dz_(start_pose.position.z),
length_(getLength(100))
{
ax_ = 2 * start_pose.position.x - 2 * goal_pose.position.x + start_vec.x + goal_vec.x;
bx_ = -3 * start_pose.position.x + 3 * goal_pose.position.x - 2 * start_vec.x - goal_vec.x;
cx_ = start_vec.x;
dx_ = start_pose.position.x;

ay_ = 2 * start_pose.position.y - 2 * goal_pose.position.y + start_vec.y + goal_vec.y;
by_ = -3 * start_pose.position.y + 3 * goal_pose.position.y - 2 * start_vec.y - goal_vec.y;
cy_ = start_vec.y;
dy_ = start_pose.position.y;

az_ = 2 * start_pose.position.z - 2 * goal_pose.position.z + start_vec.z + goal_vec.z;
bz_ = -3 * start_pose.position.z + 3 * goal_pose.position.z - 2 * start_vec.z - goal_vec.z;
cz_ = start_vec.z;
dz_ = start_pose.position.z;
length_ = getLength(100);
}

double HermiteCurve::getSquaredDistanceIn2D(
Expand Down
32 changes: 32 additions & 0 deletions common/scenario_simulator_exception/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ Changelog for package scenario_simulator_exception
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

4.3.21 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Merge branch 'master' into RJD-1337/getQuadraticAccelerationDuration
* Contributors: Grzegorz Maj, Masaya Kataoka

4.3.20 (2024-10-31)
-------------------
* Merge branch 'master' into RJD-1335/requestSpeedChange
* Contributors: Grzegorz Maj

4.3.19 (2024-10-30)
-------------------

4.3.18 (2024-10-18)
-------------------
* Merge branch 'master' into feature/json/boost-json
* Merge branch 'master' into feature/json/boost-json
* Merge remote-tracking branch 'origin/master' into feature/json/boost-json
* Contributors: Kotaro Yoshimoto, f0reachARR, ぐるぐる

4.3.17 (2024-10-17)
-------------------
* Merge branch 'master' into fix/remove_warnings_from_sonarcloud
* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into fix/remove_warnings_from_sonarcloud
* Contributors: Masaya Kataoka

4.3.16 (2024-10-15)
-------------------

4.3.15 (2024-10-10)
-------------------
* Merge branch 'master' into feature/faster-compilation
Expand Down
2 changes: 1 addition & 1 deletion common/scenario_simulator_exception/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>scenario_simulator_exception</name>
<version>4.3.15</version>
<version>4.3.21</version>
<description>Exception types for scenario simulator</description>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
<license>Apache License 2.0</license>
Expand Down
Loading

0 comments on commit 215a588

Please sign in to comment.