Skip to content

Commit

Permalink
deploy: 53555ff
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Feb 17, 2024
1 parent 4058e26 commit a0aa285
Show file tree
Hide file tree
Showing 28 changed files with 241 additions and 157 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified api/cpp/doctrees/environment.pickle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ Functions
---------


- :ref:`exhale_function_RpcLibAdaptorsBase_8hpp_1a4f4b3060c8be9db77d0cbd4d342023ab`

- :ref:`exhale_function_RpcLibAdaptorsBase_8hpp_1aa48460dda401d585625e850d035669c3`

- :ref:`exhale_function_RpcLibAdaptorsBase_8hpp_1abb33b0231861928bba288833a2c05173`
Expand All @@ -145,3 +143,5 @@ Functions

- :ref:`exhale_function_RpcLibAdaptorsBase_8hpp_1afb001b2ca995cc726f581621db317400`

- :ref:`exhale_function_RpcLibAdaptorsBase_8hpp_1a4f4b3060c8be9db77d0cbd4d342023ab`

Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Functions
---------


- :ref:`exhale_function_MultirotorRpcLibAdaptors_8hpp_1a4ad96bb0b0fd837d8132bf284f81932c`

- :ref:`exhale_function_MultirotorRpcLibAdaptors_8hpp_1abfcd08d1e6f1840d131bdd83c3ace4eb`

- :ref:`exhale_function_MultirotorRpcLibAdaptors_8hpp_1a4ad96bb0b0fd837d8132bf284f81932c`

Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,18 @@ Program Listing for File RpcLibClientBase.hpp
bool simRunConsoleCommand(const std::string &command);
// sensor APIs
nervosys::autonomylib::LidarData getLidarData(const std::string &lidar_name = "", const std::string &vehicle_name = "") const;
nervosys::autonomylib::LidarData getLidarData(const std::string &lidar_name = "",
const std::string &vehicle_name = "") const;
nervosys::autonomylib::ImuBase::Output getImuData(const std::string &imu_name = "",
const std::string &vehicle_name = "") const;
const std::string &vehicle_name = "") const;
nervosys::autonomylib::BarometerBase::Output getBarometerData(const std::string &barometer_name = "",
const std::string &vehicle_name = "") const;
const std::string &vehicle_name = "") const;
nervosys::autonomylib::MagnetometerBase::Output getMagnetometerData(const std::string &magnetometer_name = "",
const std::string &vehicle_name = "") const;
const std::string &vehicle_name = "") const;
nervosys::autonomylib::GpsBase::Output getGpsData(const std::string &gps_name = "",
const std::string &vehicle_name = "") const;
const std::string &vehicle_name = "") const;
nervosys::autonomylib::DistanceSensorData getDistanceSensorData(const std::string &distance_sensor_name = "",
const std::string &vehicle_name = "") const;
const std::string &vehicle_name = "") const;
Pose simGetVehiclePose(const std::string &vehicle_name = "") const;
void simSetVehiclePose(const Pose &pose, bool ignore_collision, const std::string &vehicle_name = "");
Expand Down Expand Up @@ -173,7 +174,8 @@ Program Listing for File RpcLibClientBase.hpp
bool external = false);
// end CinemAutonomySim
bool simTestLineOfSightToPoint(const nervosys::autonomylib::GeoPoint &point, const std::string &vehicle_name = "");
bool simTestLineOfSightBetweenPoints(const nervosys::autonomylib::GeoPoint &point1, const nervosys::autonomylib::GeoPoint &point2);
bool simTestLineOfSightBetweenPoints(const nervosys::autonomylib::GeoPoint &point1,
const nervosys::autonomylib::GeoPoint &point2);
vector<nervosys::autonomylib::GeoPoint> simGetWorldExtents();
vector<MeshPositionVertexBuffersResponse> simGetMeshPositionVertexBuffers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Program Listing for File FastPhysicsEngine.hpp
// mean we are coliding with the ground???
// || Utils::isApproximatelyEqual(std::abs(normal_body.x()), 1.0f, kAxisTolerance)
// || Utils::isApproximatelyEqual(std::abs(normal_body.y()), 1.0f, kAxisTolerance)
// looks like we are coliding with the ground. We don't want the ground to be so bouncy
// so we reduce the coefficient of restitution. 0 means no bounce.
// TODO: it would be better if we did this based on the material we are landing on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Program Listing for File PhysicsBodyVertex.hpp
real_T getDragFactor() const { return drag_factor_; }
void setDragFactor(real_T val) { drag_factor_ = val; }
PhysicsBodyVertex() {} // allow default constructor with later call for initialize
PhysicsBodyVertex() {} // allow default constructor with later call for initialize
PhysicsBodyVertex(const Vector3r &position, const Vector3r &normal, real_T drag_factor = 0) {
initialize(position, normal, drag_factor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Program Listing for File LidarSimpleParams.hpp
} else {
throw std::runtime_error("Unknown requested data frame");
}
external_controller = settings_json.getBool("ExternalController", external_controller);
vertical_FOV_upper = settings_json.getFloat("VerticalFOVUpper", Utils::nan<float>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Program Listing for File MagnetometerSimple.hpp
throw std::invalid_argument("magnetic reference source type is not recognized");
}
}
Output getOutputInternal() {
Output output;
const GroundTruth &ground_truth = getGroundTruth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Program Listing for File MultirotorRpcLibClient.hpp
DrivetrainType drivetrain = DrivetrainType::MaxDegreeOfFreedom,
const YawMode &yaw_mode = YawMode(),
const std::string &vehicle_name = "");
MultirotorRpcLibClient
*moveByVelocityZBodyFrameAsync(float vx, float vy, float z, float duration,
MultirotorRpcLibClient *
moveByVelocityZBodyFrameAsync(float vx, float vy, float z, float duration,
DrivetrainType drivetrain = DrivetrainType::MaxDegreeOfFreedom,
const YawMode &yaw_mode = YawMode(), const std::string &vehicle_name = "");
MultirotorRpcLibClient *moveByMotorPWMsAsync(float front_right_pwm, float rear_left_pwm, float front_left_pwm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ Program Listing for File SafetyEval.cpp
// is this dest_pos cur_pos within the fence?
checkFence(dest_pos, cur_pos, result);
if (!(enable_reasons_ & SafetyViolationType_::Obstacle)) { return; }
if (!(enable_reasons_ & SafetyViolationType_::Obstacle)) {
return;
}
// transform dest_pos vector to body frame
const Vector3r cur_dest = dest_pos - cur_pos;
Expand Down Expand Up @@ -159,7 +161,9 @@ Program Listing for File SafetyEval.cpp
void SafetyEval::setSuggestedVelocity(SafetyEval::EvalResult &result, const Quaternionr &quaternion) {
result.suggested_vec = Vector3r::Zero(); // default suggestion
if (obs_strategy_ == ObsAvoidanceStrategy::RaiseException) { return; }
if (obs_strategy_ == ObsAvoidanceStrategy::RaiseException) {
return;
}
int ref_tick;
int ticks = obs_xy_ptr_->getTicks();
Expand All @@ -172,7 +176,7 @@ Program Listing for File SafetyEval.cpp
ref_tick = 0; // default doesn't matter as we will raise exception
}
for (int i = 0; i <= ticks/2; ++i) {
for (int i = 0; i <= ticks / 2; ++i) {
// evaluate right and left side of circle
ObstacleMap::ObstacleInfo right_obs = obs_xy_ptr_->hasObstacle(ref_tick + i, ref_tick + i);
ObstacleMap::ObstacleInfo left_obs = obs_xy_ptr_->hasObstacle(ref_tick - i, ref_tick - i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ Program Listing for File MultirotorApiBase.cpp
const YawMode &yaw_mode) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
float pitch, roll, yaw;
VectorMath::toEulerianAngle(getKinematicsEstimated().pose.orientation, pitch, roll, yaw);
Expand All @@ -111,7 +113,9 @@ Program Listing for File MultirotorApiBase.cpp
const YawMode &yaw_mode) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
float pitch, roll, yaw;
VectorMath::toEulerianAngle(getKinematicsEstimated().pose.orientation, pitch, roll, yaw);
Expand All @@ -134,7 +138,9 @@ Program Listing for File MultirotorApiBase.cpp
float rear_right_pwm, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -148,7 +154,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::moveByRollPitchYawZ(float roll, float pitch, float yaw, float z, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -162,7 +170,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::moveByRollPitchYawThrottle(float roll, float pitch, float yaw, float throttle, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -177,7 +187,9 @@ Program Listing for File MultirotorApiBase.cpp
float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -191,7 +203,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::moveByRollPitchYawrateZ(float roll, float pitch, float yaw_rate, float z, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -205,7 +219,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::moveByAngleRatesZ(float roll_rate, float pitch_rate, float yaw_rate, float z, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -220,7 +236,9 @@ Program Listing for File MultirotorApiBase.cpp
float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
return waitForFunction(
[&]() {
Expand All @@ -235,7 +253,9 @@ Program Listing for File MultirotorApiBase.cpp
const YawMode &yaw_mode) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
YawMode adj_yaw_mode(yaw_mode.is_rate, yaw_mode.yaw_or_rate);
adjustYaw(vx, vy, drivetrain, adj_yaw_mode);
Expand All @@ -253,7 +273,9 @@ Program Listing for File MultirotorApiBase.cpp
const YawMode &yaw_mode) {
SingleTaskCall lock(this);
if (duration <= 0) { return false; }
if (duration <= 0) {
return false;
}
YawMode adj_yaw_mode(yaw_mode.is_rate, yaw_mode.yaw_or_rate);
adjustYaw(vx, vy, drivetrain, adj_yaw_mode);
Expand Down Expand Up @@ -354,7 +376,7 @@ Program Listing for File MultirotorApiBase.cpp
float seg_velocity = path_segs.at(next_path_loc.seg_index).seg_velocity;
float path_length_remaining =
path_length - path_segs.at(cur_path_loc.seg_index).seg_path_length - cur_path_loc.offset;
if (seg_velocity > getMultirotorApiParams().min_vel_for_breaking && path_length_remaining <= breaking_dist) {
seg_velocity = getMultirotorApiParams().breaking_vel;
// Utils::logMessage("path_length_remaining = %f, Switched to breaking vel %f", path_length_remaining,
Expand All @@ -366,7 +388,9 @@ Program Listing for File MultirotorApiBase.cpp
path_segs.at(cur_path_loc.seg_index).start_z);
// sleep for rest of the cycle
if (!waiter.sleep()) { return false; }
if (!waiter.sleep()) {
return false;
}
/* Below, P is previous position on path, N is next goal and C is our current position.
Expand Down Expand Up @@ -493,9 +517,11 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::moveByManual(float vx_max, float vy_max, float z_min, float duration, DrivetrainType drivetrain,
const YawMode &yaw_mode) {
SingleTaskCall lock(this);
const float kMaxMessageAge = 0.1f // 0.1 sec
const float kMaxRCValue = 10000f;
if (duration <= 0) { return true; }
const float kMaxMessageAge = 0.1f // 0.1 sec
const float kMaxRCValue = 10000f;
if (duration <= 0) {
return true;
}
// freeze the quaternion
Quaternionr starting_quaternion = getKinematicsEstimated().pose.orientation;
Expand Down Expand Up @@ -537,7 +563,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::rotateToYaw(float yaw, float timeout_sec, float margin) {
SingleTaskCall lock(this);
if (timeout_sec <= 0) { return true; }
if (timeout_sec <= 0) {
return true;
}
auto start_pos = getPosition();
float yaw_target = VectorMath::normalizeAngle(yaw);
Expand Down Expand Up @@ -566,7 +594,9 @@ Program Listing for File MultirotorApiBase.cpp
bool MultirotorApiBase::rotateByYawRate(float yaw_rate, float duration) {
SingleTaskCall lock(this);
if (duration <= 0) { return true; }
if (duration <= 0) {
return true;
}
auto start_pos = getPosition();
YawMode yaw_mode(true, yaw_rate);
Expand Down Expand Up @@ -761,12 +791,12 @@ Program Listing for File MultirotorApiBase.cpp
// send commands
// try to maintain altitude if path was in XY plan only, velocity based control is not as good
if (std::abs(cur.z() - dest.z()) <= getDistanceAccuracy()) { // for paths in XY plan current code leaves z untouched,
// so we can compare with strict equality
if (std::abs(cur.z() - dest.z()) <= getDistanceAccuracy()) { // for paths in XY plan current code leaves z
// untouched, so we can compare with strict equality
moveByVelocityInternal(velocity_vect.x(), velocity_vect.y(), 0, yaw_mode);
} else {
} else {
moveByVelocityInternal(velocity_vect.x(), velocity_vect.y(), velocity_vect.z(), yaw_mode);
}
}
}
bool MultirotorApiBase::setSafety(SafetyEval::SafetyViolationType enable_reasons, float obs_clearance,
Expand Down Expand Up @@ -812,19 +842,25 @@ Program Listing for File MultirotorApiBase.cpp
}
bool MultirotorApiBase::safetyCheckVelocity(const Vector3r &velocity) {
if (safety_eval_ptr_ == nullptr) { return true; } // safety checks disabled
if (safety_eval_ptr_ == nullptr) {
return true;
} // safety checks disabled
const auto &result = safety_eval_ptr_->isSafeVelocity(getPosition(), velocity, getOrientation());
return emergencyManeuverIfUnsafe(result);
}
bool MultirotorApiBase::safetyCheckVelocityZ(float vx, float vy, float z) {
if (safety_eval_ptr_ == nullptr) { return true; } // safety checks disabled
if (safety_eval_ptr_ == nullptr) {
return true;
} // safety checks disabled
const auto &result = safety_eval_ptr_->isSafeVelocityZ(getPosition(), vx, vy, z, getOrientation());
return emergencyManeuverIfUnsafe(result);
}
bool MultirotorApiBase::safetyCheckDestination(const Vector3r &dest_pos) {
if (safety_eval_ptr_ == nullptr) { return true; } // safety checks disabled
if (safety_eval_ptr_ == nullptr) {
return true;
} // safety checks disabled
const auto &result = safety_eval_ptr_->isSafeDestination(getPosition(), dest_pos, getOrientation());
return emergencyManeuverIfUnsafe(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ <h2 id="classes">Classes<a class="headerlink" href="#classes" title="Link to thi
</ul>
<h2 id="functions">Functions<a class="headerlink" href="#functions" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1a4f4b3060c8be9db77d0cbd4d342023ab.html#exhale-function-rpclibadaptorsbase-8hpp-1a4f4b3060c8be9db77d0cbd4d342023ab"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::SafetyEval::ObsAvoidanceStrategy)</span></a></p></li>
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1aa48460dda401d585625e850d035669c3.html#exhale-function-rpclibadaptorsbase-8hpp-1aa48460dda401d585625e850d035669c3"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::SafetyEval::SafetyViolationType_)</span></a></p></li>
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1abb33b0231861928bba288833a2c05173.html#exhale-function-rpclibadaptorsbase-8hpp-1abb33b0231861928bba288833a2c05173"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::WorldSimApiBase::WeatherParameter)</span></a></p></li>
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1a46cd14d414e8fc72032ef2edc817fca7.html#exhale-function-rpclibadaptorsbase-8hpp-1a46cd14d414e8fc72032ef2edc817fca7"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::GpsBase::GnssFixType)</span></a></p></li>
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1afb001b2ca995cc726f581621db317400.html#exhale-function-rpclibadaptorsbase-8hpp-1afb001b2ca995cc726f581621db317400"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::ImageCaptureBase::ImageType)</span></a></p></li>
<li><p><a class="reference internal" href="function_RpcLibAdaptorsBase_8hpp_1a4f4b3060c8be9db77d0cbd4d342023ab.html#exhale-function-rpclibadaptorsbase-8hpp-1a4f4b3060c8be9db77d0cbd4d342023ab"><span class="std std-ref">Function MSGPACK_ADD_ENUM(nervosys::autonomylib::SafetyEval::ObsAvoidanceStrategy)</span></a></p></li>
</ul>


Expand Down
Loading

0 comments on commit a0aa285

Please sign in to comment.