Skip to content

Commit

Permalink
Address code quality warnings (3/N: unused-parameter) (#17)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #17

Differential Revision: D58827924
  • Loading branch information
jeongseok-meta authored and facebook-github-bot committed Jun 20, 2024
1 parent 331ecb5 commit 441cd6d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ double ModelParametersSequenceErrorFunctionT<T>::getError(
template <typename T>
double ModelParametersSequenceErrorFunctionT<T>::getGradient(
gsl::span<const ModelParametersT<T>> modelParameters,
gsl::span<const SkeletonStateT<T>> skelStates,
gsl::span<const SkeletonStateT<T>> /* skelStates */,
Eigen::Ref<Eigen::VectorX<T>> gradient) const {
// ignore if we don't have any reasonable data
if (targetWeights_.size() !=
Expand Down Expand Up @@ -98,7 +98,7 @@ size_t ModelParametersSequenceErrorFunctionT<T>::getJacobianSize() const {
template <typename T>
double ModelParametersSequenceErrorFunctionT<T>::getJacobian(
gsl::span<const ModelParametersT<T>> modelParameters,
gsl::span<const SkeletonStateT<T>> skelStates,
gsl::span<const SkeletonStateT<T>> /* skelStates */,
Eigen::Ref<Eigen::MatrixX<T>> jacobian,
Eigen::Ref<Eigen::VectorX<T>> residual,
int& usedRows) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void StateSequenceErrorFunctionT<T>::setTargetWeights(

template <typename T>
double StateSequenceErrorFunctionT<T>::getError(
gsl::span<const ModelParametersT<T>> modelParameters,
gsl::span<const ModelParametersT<T>> /* modelParameters */,
gsl::span<const SkeletonStateT<T>> skelStates) const {
MT_PROFILE_EVENT("StateSequenceError: getError");

Expand Down Expand Up @@ -85,7 +85,7 @@ double StateSequenceErrorFunctionT<T>::getError(

template <typename T>
double StateSequenceErrorFunctionT<T>::getGradient(
gsl::span<const ModelParametersT<T>> modelParameters,
gsl::span<const ModelParametersT<T>> /* modelParameters */,
gsl::span<const SkeletonStateT<T>> skelStates,
Eigen::Ref<Eigen::VectorX<T>> gradient) const {
MT_PROFILE_EVENT("StateSequenceError: getGradient");
Expand Down Expand Up @@ -206,7 +206,7 @@ size_t StateSequenceErrorFunctionT<T>::getJacobianSize() const {

template <typename T>
double StateSequenceErrorFunctionT<T>::getJacobian(
gsl::span<const ModelParametersT<T>> modelParameters,
gsl::span<const ModelParametersT<T>> /* modelParameters */,
gsl::span<const SkeletonStateT<T>> skelStates,
Eigen::Ref<Eigen::MatrixX<T>> jacobian_full,
Eigen::Ref<Eigen::VectorX<T>> residual_full,
Expand Down
8 changes: 4 additions & 4 deletions momentum/character_solver/vertex_error_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void VertexErrorFunctionT<T>::calculateDWorldPos(

template <typename T>
double VertexErrorFunctionT<T>::calculatePositionGradient(
const ModelParametersT<T>& modelParameters,
const ModelParametersT<T>& /* modelParameters */,
const SkeletonStateT<T>& state,
const VertexConstraintT<T>& constr,
Eigen::Ref<Eigen::VectorX<T>> gradient) const {
Expand Down Expand Up @@ -415,7 +415,7 @@ double VertexErrorFunctionT<T>::calculatePositionGradient(

template <typename T>
double VertexErrorFunctionT<T>::calculatePositionJacobian(
const ModelParametersT<T>& modelParameters,
const ModelParametersT<T>& /* modelParameters */,
const SkeletonStateT<T>& state,
const VertexConstraintT<T>& constr,
Ref<Eigen::MatrixX<T>> jac,
Expand Down Expand Up @@ -521,7 +521,7 @@ double VertexErrorFunctionT<T>::calculatePositionJacobian(

template <typename T>
double VertexErrorFunctionT<T>::calculateNormalGradient(
const ModelParametersT<T>& modelParameters,
const ModelParametersT<T>& /* modelParameters */,
const SkeletonStateT<T>& state,
const VertexConstraintT<T>& constr,
const T sourceNormalWeight,
Expand Down Expand Up @@ -629,7 +629,7 @@ double VertexErrorFunctionT<T>::calculateNormalGradient(

template <typename T>
double VertexErrorFunctionT<T>::calculateNormalJacobian(
const ModelParametersT<T>& modelParameters,
const ModelParametersT<T>& /* modelParameters */,
const SkeletonStateT<T>& state,
const VertexConstraintT<T>& constr,
const T sourceNormalWeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ template <typename T>
Eigen::VectorX<T> FullyDifferentiableMotionErrorFunctionT<T>::d_gradient_d_input_dot(
const std::string& inputName,
const ModelParametersT<T>& params,
const SkeletonStateT<T>& state,
const SkeletonStateT<T>& /* state */,
Eigen::Ref<const Eigen::VectorX<T>> inputVec) {
// The error function is just
// \sum_i (w_i * (param_i - targetParam_i))^2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ template <typename T>
Eigen::VectorX<T> FullyDifferentiablePosePriorErrorFunctionT<T>::d_gradient_d_input_dot(
const std::string& inputName,
const ModelParametersT<T>& params,
const SkeletonStateT<T>& state,
const SkeletonStateT<T>& /* state */,
Eigen::Ref<const Eigen::VectorX<T>> inputVec) {
if (!this->posePrior_) {
throw std::runtime_error("No pose prior loaded, can't set values.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ JetType FullyDifferentiableStateErrorFunctionT<T>::calculateGradient_dot(
template <typename T>
Eigen::VectorX<T> FullyDifferentiableStateErrorFunctionT<T>::d_gradient_d_input_dot(
const std::string& inputName,
const ModelParametersT<T>& params,
const ModelParametersT<T>& /* params */,
const SkeletonStateT<T>& state,
Eigen::Ref<const Eigen::VectorX<T>> inputVec) {
const auto& targetState = this->getTargetState();
Expand Down
10 changes: 4 additions & 6 deletions momentum/io/gltf/gltf_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Locator createLocator(const fx::gltf::Node& node, const nlohmann::json& extensio
return loc;
}

Joint createJoint(const fx::gltf::Node& node, const nlohmann::json& extension) {
Joint createJoint(const fx::gltf::Node& node) {
Joint joint;
joint.name = node.name;
joint.parent = kInvalidIndex;
Expand Down Expand Up @@ -303,7 +303,7 @@ void loadHierarchyRecursive(
locators.push_back(loc);
nodeToObjectMap[nodeId] = locators.size() - 1;
} else if ((!useExtension && (node.mesh < 0)) || type == "skeleton_joint") {
Joint joint = createJoint(node, extension);
Joint joint = createJoint(node);
joint.parent = parentJointId;
joints.push_back(joint);
nodeToObjectMap[nodeId] = joints.size() - 1;
Expand Down Expand Up @@ -611,9 +611,7 @@ void loadGlobalExtensions(const fx::gltf::Document& model, Character& character)
}
}

Character populateCharacterFromModel(
const fx::gltf::Document& model,
const filesystem::path& filename) {
Character populateCharacterFromModel(const fx::gltf::Document& model) {
// #TODO: set character name
Character result;

Expand Down Expand Up @@ -852,7 +850,7 @@ Character loadGltfCharacter(fx::gltf::Document& model) {
// ---------------------------------------------
Character result;
try {
result = populateCharacterFromModel(model, "in-document");
result = populateCharacterFromModel(model);
} catch (std::runtime_error& err) {
throw std::runtime_error(fmt::format("Unable to load gltf : {}", std::string(err.what())));
}
Expand Down
2 changes: 1 addition & 1 deletion momentum/io/gltf/utils/accessor_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ std::vector<T> copyAlignedAccessorBuffer(const fx::gltf::Document& model, int32_

// template to set accessor
template <typename T>
void setAccessorType(fx::gltf::Accessor& accessor) {
void setAccessorType(fx::gltf::Accessor& /* accessor */) {
throw std::runtime_error("Unsupported data type");
}

Expand Down

0 comments on commit 441cd6d

Please sign in to comment.