Skip to content

Commit

Permalink
Merge pull request gazebosim#380 from scpeters/merge_6_7_all
Browse files Browse the repository at this point in the history
Merge 6 -> 7 (all of it)
  • Loading branch information
scpeters authored Mar 1, 2022
2 parents 27de5e0 + bb54720 commit 5eefd3c
Show file tree
Hide file tree
Showing 124 changed files with 4,353 additions and 1,154 deletions.
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ python3-distutils
python3-pybind11
ruby-dev
swig
python3-pybind11
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ jobs:
with:
cpplint-enabled: true
cppcheck-enabled: true
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,26 @@ if (SWIG_FOUND)
else()
message (STATUS "Searching for Ruby - found version ${RUBY_VERSION}.")
endif()
endif()

########################################
# Include python
find_package(PythonInterp 3 REQUIRED) # change to Python3 when Bionic is EOL
find_package(PythonLibs QUIET)
if (NOT PYTHONLIBS_FOUND)
message (STATUS "Searching for Python - not found.")
########################################
# Python bindings
include(IgnPython)
find_package(PythonLibs QUIET)
if (NOT PYTHONLIBS_FOUND)
IGN_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python - not found.")
else()
message (STATUS "Searching for Python - found version ${PYTHONLIBS_VERSION_STRING}.")

set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.2 QUIET)

if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
message (STATUS "Searching for Python - found version ${PYTHONLIBS_VERSION_STRING}.")
IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()

Expand Down
160 changes: 160 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,166 @@ instead.

### Ignition Math 6.x.x

## Ignition Math 6.10.0 (2022-01-26)

1. Use const instead of constexpr in Ellipsoid constructor
* [Pull request #366](https://github.com/ignitionrobotics/ign-math/pull/366)

1. Refactor finding pybind11
* [Pull request #360](https://github.com/ignitionrobotics/ign-math/pull/360)

1. Fix Focal on Jenkins
* [Pull request #364](https://github.com/ignitionrobotics/ign-math/pull/364)

1. kmeans example in C++ and Python
* [Pull request #356](https://github.com/ignitionrobotics/ign-math/pull/356)

1. Small fixed in doxygen
* [Pull request #355](https://github.com/ignitionrobotics/ign-math/pull/355)

1. Added Python Getting started tutorial
* [Pull request #362](https://github.com/ignitionrobotics/ign-math/pull/362)

1. Move SWIG interfaces from Python to Ruby
* [Pull request #354](https://github.com/ignitionrobotics/ign-math/pull/354)

1. Added pybind11 interfaces for various classes
1. SphericalCoordinates
* [Pull request #357](https://github.com/ignitionrobotics/ign-math/pull/357)
1. Vector3Stats
* [Pull request #351](https://github.com/ignitionrobotics/ign-math/pull/351)
1. SignalStats
* [Pull request #343](https://github.com/ignitionrobotics/ign-math/pull/343)
1. Sphere
* [Pull request #352](https://github.com/ignitionrobotics/ign-math/pull/352)
1. Frustum
* [Pull request #353](https://github.com/ignitionrobotics/ign-math/pull/353)
1. Plane
* [Pull request #346](https://github.com/ignitionrobotics/ign-math/pull/346)
1. Cylinder
* [Pull request #348](https://github.com/ignitionrobotics/ign-math/pull/348)
1. OrientedBox
* [Pull request #276](https://github.com/ignitionrobotics/ign-math/pull/276)
* [Pull request #350](https://github.com/ignitionrobotics/ign-math/pull/350)
1. Inertial
* [Pull request #349](https://github.com/ignitionrobotics/ign-math/pull/349)
1. Matrix4
* [Pull request #337](https://github.com/ignitionrobotics/ign-math/pull/337)
1. PID
* [Pull request #323](https://github.com/ignitionrobotics/ign-math/pull/323)
* [Pull request #361](https://github.com/ignitionrobotics/ign-math/pull/361)
1. Temperature
* [Pull request #330](https://github.com/ignitionrobotics/ign-math/pull/330)
1. DiffDriveOdometry (with examples)
* [Pull request #314](https://github.com/ignitionrobotics/ign-math/pull/314)
1. MassMatrix3
* [Pull request #345](https://github.com/ignitionrobotics/ign-math/pull/345)
1. AxisAlignedBox
* [Pull request #338](https://github.com/ignitionrobotics/ign-math/pull/338)
* [Pull request #281](https://github.com/ignitionrobotics/ign-math/pull/281)
1. GaussMarkovProcess (with examples)
* [Pull request #315](https://github.com/ignitionrobotics/ign-math/pull/315)
1. RotationSpline
* [Pull request #339](https://github.com/ignitionrobotics/ign-math/pull/339)
1. Material
* [Pull request #340](https://github.com/ignitionrobotics/ign-math/pull/340)
1. Kmeans
* [Pull request #341](https://github.com/ignitionrobotics/ign-math/pull/341)
1. Triangle3
* [Pull request #335](https://github.com/ignitionrobotics/ign-math/pull/335)
1. Pose3
* [Pull request #334](https://github.com/ignitionrobotics/ign-math/pull/334)
1. Triangle
* [Pull request #333](https://github.com/ignitionrobotics/ign-math/pull/333)
1. Spline
* [Pull request #332](https://github.com/ignitionrobotics/ign-math/pull/332)
1. Filter
* [Pull request #336](https://github.com/ignitionrobotics/ign-math/pull/336)
1. SemanticVersion
* [Pull request #331](https://github.com/ignitionrobotics/ign-math/pull/331)
1. Matrix3
* [Pull request #325](https://github.com/ignitionrobotics/ign-math/pull/325)
1. MovingWindowFilter
* [Pull request #321](https://github.com/ignitionrobotics/ign-math/pull/321)
1. Line3
* [Pull request #317](https://github.com/ignitionrobotics/ign-math/pull/317)
1. Quaternion
* [Pull request #324](https://github.com/ignitionrobotics/ign-math/pull/324)
* [Pull request #361](https://github.com/ignitionrobotics/ign-math/pull/361)
1. StopWatch
* [Pull request #319](https://github.com/ignitionrobotics/ign-math/pull/319)
1. RollingMean
* [Pull request #322](https://github.com/ignitionrobotics/ign-math/pull/322)
1. Line2
* [Pull request #316](https://github.com/ignitionrobotics/ign-math/pull/316)
1. Color
* [Pull request #318](https://github.com/ignitionrobotics/ign-math/pull/318)
1. Helpers
* [Pull request #313](https://github.com/ignitionrobotics/ign-math/pull/313)
1. Rand (with examples)
* [Pull request #312](https://github.com/ignitionrobotics/ign-math/pull/312)
1. Angle
* [Pull request #311](https://github.com/ignitionrobotics/ign-math/pull/311)
1. Vector2, Vector3 and Vector4
* [Pull request #280](https://github.com/ignitionrobotics/ign-math/pull/280)

1. Fix Color::HSV() incorrect hue output
* [Pull request #320](https://github.com/ignitionrobotics/ign-math/pull/320)

1. Add example and modify document for class Color
* [Pull request #304](https://github.com/ignitionrobotics/ign-math/pull/304)

1. Document that euler angles should be in radians for quaternion constructor
* [Pull request #298](https://github.com/ignitionrobotics/ign-math/pull/298)

1. Fix windows warnings in Vector2, 3 and 4
* [Pull request #284](https://github.com/ignitionrobotics/ign-math/pull/284)

1. Modified cmake target name for Ruby interfaces
* [Pull request #285](https://github.com/ignitionrobotics/ign-math/pull/285)

1. Frustrum Python interface
* [Pull request #278](https://github.com/ignitionrobotics/ign-math/pull/278)

1. quaternion_from_euler example: input degrees
* [Pull request #282](https://github.com/ignitionrobotics/ign-math/pull/282)

1. Internal URL fixed (paragraph 266)
* [Pull request #279](https://github.com/ignitionrobotics/ign-math/pull/279)

1. Added tutorials for vector, angle, triangle and rotation
* [Pull request #249](https://github.com/ignitionrobotics/ign-math/pull/249)

1. Inertial Python interface
* [Pull request #275](https://github.com/ignitionrobotics/ign-math/pull/275)

1. Box Python interfaces
* [Pull request #273](https://github.com/ignitionrobotics/ign-math/pull/273)

1. DiffDriveOdometry Python interface
* [Pull request #265](https://github.com/ignitionrobotics/ign-math/pull/265)

1. Sphere Python interface
* [Pull request #277](https://github.com/ignitionrobotics/ign-math/pull/277)

1. Plane Python interfaces
* [Pull request #272](https://github.com/ignitionrobotics/ign-math/pull/272)

1. Cylinder Python interface
* [Pull request #274](https://github.com/ignitionrobotics/ign-math/pull/274)

1. Added SphericalCoordinates Python interface
* [Pull request #263](https://github.com/ignitionrobotics/ign-math/pull/263)

1. MassMatrix3 Python interface
* [Pull request #260](https://github.com/ignitionrobotics/ign-math/pull/260)

1. AxisAlignedBox Python interface
* [Pull request #262](https://github.com/ignitionrobotics/ign-math/pull/262)

1. AxisAlignedBox: deprecate unimplemented methods
* [Pull request #261](https://github.com/ignitionrobotics/ign-math/pull/261)

## Ignition Math 6.9.2 (2021-10-14)

1. Added StopWatch Python Interface
Expand Down
6 changes: 6 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ target_link_libraries(angle_example ignition-math${IGN_MATH_VER}::ignition-math$
add_executable(color_example color_example.cc)
target_link_libraries(color_example ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

add_executable(diff_drive_odometry diff_drive_odometry.cc)
target_link_libraries(diff_drive_odometry ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

add_executable(gauss_markov_process gauss_markov_process_example.cc)
target_link_libraries(gauss_markov_process ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

Expand All @@ -21,6 +24,9 @@ target_link_libraries(graph_example ignition-math${IGN_MATH_VER}::ignition-math$
add_executable(helpers_example helpers_example.cc)
target_link_libraries(helpers_example ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

add_executable(kmeans kmeans.cc)
target_link_libraries(kmeans ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

add_executable(matrix3_example matrix3_example.cc)
target_link_libraries(matrix3_example ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})

Expand Down
2 changes: 1 addition & 1 deletion examples/angle_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# installed.
#
# Modify the PYTHONPATH environment variable to include the ignition math
# library install path. For example, if you install to /user:
# library install path. For example, if you install to /usr:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#
Expand Down
97 changes: 97 additions & 0 deletions examples/diff_drive_odometry.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* 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.
*
*/
//! [complete]
#include <iostream>
#include <chrono>

#include <ignition/math/Angle.hh>
#include <ignition/math/Helpers.hh>
#include <ignition/math/DiffDriveOdometry.hh>

int main(int argc, char **argv)
{

//! [Create a DiffDriveOdometry]
ignition::math::DiffDriveOdometry odom;
//! [Create an DiffDriveOdometry]

double wheelSeparation = 2.0;
double wheelRadius = 0.5;
double wheelCircumference = 2 * IGN_PI * wheelRadius;

// This is the linear distance traveled per degree of wheel rotation.
double distPerDegree = wheelCircumference / 360.0;

// Setup the wheel parameters, and initialize
odom.SetWheelParams(wheelSeparation, wheelRadius, wheelRadius);
auto startTime = std::chrono::steady_clock::now();
odom.Init(startTime);

// Sleep for a little while, then update the odometry with the new wheel
// position.
std::cout << "--- Rotate both wheels by 1 degree. ---" << '\n';
auto time1 = startTime + std::chrono::milliseconds(100);
odom.Update(IGN_DTOR(1.0), IGN_DTOR(1.0), time1);

std::cout << "\tLinear velocity:\t" << distPerDegree / 0.1 << " m/s"
<< "\n\tOdom linear velocity:\t" << odom.LinearVelocity() << " m/s"
<< std::endl;

std::cout << "Angular velocity should be zero since the \"robot\" is traveling\n"
<< "in a straight line:\n"
<< "\tOdom angular velocity:\t"
<< *odom.AngularVelocity() << " rad/s" << std::endl;

// Sleep again, this time rotate the left wheel by 1 and the right wheel by 2
// degrees.
std::cout << "--- This time rotate the left wheel by 1 and the right wheel "
<< "by 2 degrees ---"
<< std::endl;
auto time2 = time1 + std::chrono::milliseconds(100);
odom.Update(IGN_DTOR(2.0), IGN_DTOR(3.0), time2);

std::cout << "The heading should be the arc tangent of the linear distance\n"
<< "traveled by the right wheel (the left wheel was stationary)\n"
<< "divided by the wheel separation.\n"
<< "\tHeading:\t\t" << atan2(distPerDegree, wheelSeparation) << " rad"
<< "\n\tOdom Heading:\t\t" << *odom.Heading() << " rad" << '\n';

// The X odom reading should have increased by the sine of the heading *
// half the wheel separation.
double xDistTraveled =
sin(atan2(distPerDegree, wheelSeparation)) * wheelSeparation * 0.5;
double prevXPos = distPerDegree * 2.0;
std::cout << "\tX distance traveled:\t" << xDistTraveled + prevXPos << " m"
<< "\n\tOdom X:\t\t" << odom.X() << " m" << std::endl;

// The Y odom reading should have increased by the cosine of the heading *
// half the wheel separation.
double yDistTraveled = (wheelSeparation * 0.5) -
cos(atan2(distPerDegree, wheelSeparation)) * wheelSeparation * 0.5;
double prevYPos = 0.0;
std::cout << "\tY distance traveled:\t" << yDistTraveled + prevYPos << " m"
<< "\n\tOdom Y:\t\t" << odom.Y() << " m" << std::endl;

std::cout << "Angular velocity should be the difference between the x and y\n"
<< "distance traveled divided by the wheel separation divided by\n"
<< "the seconds elapsed.\n"
<< "\tAngular velocity:\t"
<< ((xDistTraveled - yDistTraveled) / wheelSeparation) / 0.1 << " rad/s"
<< "\n\tOdom angular velocity:\t" << *odom.AngularVelocity() << " rad/s"
<< std::endl;
}
//! [complete]
Loading

0 comments on commit 5eefd3c

Please sign in to comment.