本文整理汇总了C++中quantity::value方法的典型用法代码示例。如果您正苦于以下问题:C++ quantity::value方法的具体用法?C++ quantity::value怎么用?C++ quantity::value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quantity
的用法示例。
在下文中一共展示了quantity::value方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cartesianPositionToWheelPositions
///Calculates from the cartesian position the wheel positions
///@param longitudinalPosition is the forward or backward position
///@param transversalPosition is the sideway position
///@param orientation is the rotation around the center
///@param wheelPositions are the individual positions of the wheels
void FourSwedishWheelOmniBaseKinematic::cartesianPositionToWheelPositions(const quantity<si::length>& longitudinalPosition, const quantity<si::length>& transversalPosition, const quantity<plane_angle>& orientation, std::vector<quantity<plane_angle> >& wheelPositions) {
// Bouml preserved body begin 000C08F1
quantity<plane_angle> Rad_FromX;
quantity<plane_angle> Rad_FromY;
quantity<plane_angle> Rad_FromTheta;
wheelPositions.assign(4, Rad_FromX);
if (config.wheelRadius.value() == 0 || config.rotationRatio == 0 || config.slideRatio == 0) {
throw std::out_of_range("The wheelRadius, RotationRatio or the SlideRatio are not allowed to be zero");
}
// RadPerSec_FromX = longitudinalVelocity / config.wheelRadius;
Rad_FromX = longitudinalPosition.value() / config.wheelRadius.value() * radian;
Rad_FromY = transversalPosition.value() / (config.wheelRadius.value() * config.slideRatio) * radian;
// Calculate Rotation Component
Rad_FromTheta = ((config.lengthBetweenFrontAndRearWheels + config.lengthBetweenFrontWheels) / (2.0 * config.wheelRadius)) * orientation;
wheelPositions[0] = -Rad_FromX + Rad_FromY + Rad_FromTheta;
wheelPositions[1] = Rad_FromX + Rad_FromY + Rad_FromTheta;
wheelPositions[2] = -Rad_FromX - Rad_FromY + Rad_FromTheta;
wheelPositions[3] = Rad_FromX - Rad_FromY + Rad_FromTheta;
return;
// Bouml preserved body end 000C08F1
}
示例2: cartesianVelocityToWheelVelocities
///Calculates from the cartesian velocity the individual wheel velocities
///@param longitudinalVelocity is the forward or backward velocity
///@param transversalVelocity is the sideway velocity
///@param angularVelocity is the rotational velocity around the center of the YouBot
///@param wheelVelocities are the individual wheel velocities
void FourSwedishWheelOmniBaseKinematic::cartesianVelocityToWheelVelocities(const quantity<si::velocity>& longitudinalVelocity, const quantity<si::velocity>& transversalVelocity, const quantity<si::angular_velocity>& angularVelocity, std::vector<quantity<angular_velocity> >& wheelVelocities) {
// Bouml preserved body begin 0004C071
quantity<angular_velocity> RadPerSec_FromX;
quantity<angular_velocity> RadPerSec_FromY;
quantity<angular_velocity> RadPerSec_FromTheta;
wheelVelocities.assign(4, RadPerSec_FromX);
if (config.wheelRadius.value() == 0 || config.rotationRatio == 0 || config.slideRatio == 0) {
throw std::out_of_range("The wheelRadius, RotationRatio or the SlideRatio are not allowed to be zero");
}
// RadPerSec_FromX = longitudinalVelocity / config.wheelRadius;
RadPerSec_FromX = longitudinalVelocity.value() / config.wheelRadius.value() * radian_per_second;
RadPerSec_FromY = transversalVelocity.value() / (config.wheelRadius.value() * config.slideRatio) * radian_per_second;
// Calculate Rotation Component
RadPerSec_FromTheta = ((config.lengthBetweenFrontAndRearWheels + config.lengthBetweenFrontWheels) / (2.0 * config.wheelRadius)) * angularVelocity;
wheelVelocities[0] = -RadPerSec_FromX + RadPerSec_FromY + RadPerSec_FromTheta;
wheelVelocities[1] = RadPerSec_FromX + RadPerSec_FromY + RadPerSec_FromTheta;
wheelVelocities[2] = -RadPerSec_FromX - RadPerSec_FromY + RadPerSec_FromTheta;
wheelVelocities[3] = RadPerSec_FromX - RadPerSec_FromY + RadPerSec_FromTheta;
return;
// Bouml preserved body end 0004C071
}
示例3: BOOST_PREVENT_MACRO_SUBSTITUTION
inline
bool
isless BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
const quantity<Unit,Y>& q2)
{
using namespace detail;
return isless BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
}
示例4: size
ScaledProjection::ScaledProjection(
ImagePosition size,
quantity<camera::resolution> x,
quantity<camera::resolution> y )
: size(size),
to_sample( 1.0 / x.value() , 1.0 / y.value() ),
to_image( to_sample.inverse() )
{
}
示例5: from_value
inline
quantity<Unit, Y>
fmod(const quantity<Unit,Y>& q1, const quantity<Unit,Y>& q2)
{
using std::fmod;
typedef quantity<Unit,Y> quantity_type;
return quantity_type::from_value(fmod(q1.value(), q2.value()));
}
示例6: convert
static quantity<s2::length,Y> convert(const quantity<s1::length,X>& source)
{
return quantity<s2::length,Y>::from_value(2.5*source.value());
}
示例7:
inline bool operator==(quantity<Unit, Value> const& q, zero_t) {
return q.value() == 0.0;
}
示例8: accelerate
void AutoNavigator::accelerate(quantity<si::velocity, f32> targetSpeed)
{
mAccelerationFactor = targetSpeed.value() / mMaxSpeed.value();
}