-
Notifications
You must be signed in to change notification settings - Fork 75
Implement hardstops for spinningBodiesOneDOF #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,13 +70,14 @@ void SpinningBodyOneDOFStateEffector::Reset(uint64_t CurrentClock) | |
} | ||
// Ensure user specified valid angular limits | ||
if (this->theta_max < this->theta_min) { | ||
bskLogger.bskLog( | ||
BSK_ERROR, "theta_max (%f) must be greater than theta_min (%f).", this->theta_max, this->theta_min); | ||
throw std::invalid_argument("theta_max (" + std::to_string(this->theta_max) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to keep the BSK_ERROR message as well, as this is expected behavior of a BSK module across the framework. I don't mind if you also include the throw argument as well. |
||
+ ") must be greater than theta_min (" + std::to_string(this->theta_min) + ")."); | ||
} | ||
// Ensure that user specified valid initial angle | ||
if ((this->thetaInit > this->theta_max) || (this->thetaInit < this->theta_min)) { | ||
bskLogger.bskLog(BSK_ERROR, "Initial angle (%f) must be inside of body angle bounds (%f, %f).", | ||
this->thetaInit, this->theta_min, this->theta_max); | ||
throw std::invalid_argument("Initial angle (" + std::to_string(this->thetaInit) | ||
+ ") must be inside of body angle bounds (" + std::to_string(this->theta_min) + ", " | ||
+ std::to_string(this->theta_max) + ")."); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,17 @@ | |
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
||
*/ | ||
|
||
#include <stdexcept> | ||
|
||
%exception { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not following what this swig code is doing? Could you please add some comments on what is being done here? |
||
try { | ||
$action | ||
} catch (std::invalid_argument &e) { | ||
std::string s("spinningBodyOneDOF error: "), s2(e.what()); | ||
s = s + s2; | ||
SWIG_exception(SWIG_ValueError, s.c_str()); | ||
} | ||
} | ||
|
||
%module spinningBodyOneDOFStateEffector | ||
%{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split and squash these commits to the final version to clean up the commit history.