Skip to content

Commit

Permalink
Fix changelog and method derivative() in class Quaternion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayitzin committed Jan 10, 2020
1 parent 426ce10 commit 9fdaba4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
26 changes: 19 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2] - 2020-01-06
### Added
- This changelog
- This changelog.
- Script `triad.py` for future submodule implementation of TRIAD method.

### Changed
- Action `Build Python Package` builds **only** when new commit is pushed to `master` branch.
- Simplify building triads in function `triad` of submodule `orientation`.
- Fix documentation of `am2angles` and `quest` of submodule `orientation`.


## [0.2.1] - 2020-01-06
### Added
- Action `Build Python Package` to build when new commit is pushed.
- Script `triad.py` for future submodule implementation of TRIAD method.
- Class `QuaternionArray` to handle several quaternions at once.
- Add methods `log()`, `exp()`, `inv()`, `to_array()` and `to_list()` to class `Quaternion`.

### Changed
- Action `Build Python Package` builds **only** when new commit is pushed to `master` branch.
- Simplify building triads in function `triad` of submodule `orientation`.
- Fix documentation of `am2angles` and `quest` of submodule `orientation`.
- Fix and/or improve

## [0.2.0] - 2019-12-27
### Added
- Class `Quaternion` to handle quaternion operations.
- Add methods `log()`, `exp()`, `inv()`, `to_array()` and `to_list()` to class `Quaternion`.
- More definitions of colors with formats ints and floats.
- Functions `hex_to_int()` and `hex_to_float()` convert any color defined as hex into `int` and `float`.
- Badges in README to indicate basic information.

### Changed
- Improve versioning.

### Removed
- Function `R2q()` to get quaternion from rotation matrix. Method `from_DCM()` of class `Quaternion` is preferred.
9 changes: 4 additions & 5 deletions ahrs/common/quaternion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,17 +1163,16 @@ def derivative(self, w):
Returns
-------
dq/dt : array
Derivative of quaternion.
Derivative of quaternion
"""
if w.ndim != 1 or w.shape[0] != 3:
raise ValueError("Expected `w` to have shape (3,), got {}.".format(w.shape))
w = np.concatenate(([0.0], w))
F = 0.5*np.array([
[0.0, -w[0], -w[1], -w[2]],
[w[0], 0.0, w[2], -w[1]],
[w[1], -w[2], 0.0, w[0]],
[w[2], w[1], -w[0], 0.0]])
[w[0], 0.0, -w[2], w[1]],
[w[1], w[2], 0.0, -w[0]],
[w[2], -w[1], w[0], 0.0]])
return F@self.q

class QuaternionArray:
Expand Down

0 comments on commit 9fdaba4

Please sign in to comment.