Skip to content

Commit

Permalink
fixed Clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Mar 29, 2018
1 parent 50b3d0a commit 03e977f
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion AirLib/include/common/common_utils/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class Utils {

static std::time_t to_time_t(const std::string& str, bool is_dst = false, const std::string& format = "%Y-%m-%d %H:%M:%S")
{
std::tm t = {0};
std::tm t;
t.tm_isdst = is_dst ? 1 : 0;
std::istringstream ss(str);
ss >> std::get_time(&t, format.c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AdaptiveController : public IController {
double x_0[12];
GoalMode last_mode_;
//double error[3] = { 0 };
double ref_vec[10][3] = { 0 };
double ref_vec[10][3] = {{ 0 }};
double ref_sum[3] = { 0 };
double velocity_integrator[3] = { 0 };
static constexpr int array_length = 7;
Expand Down Expand Up @@ -180,7 +180,7 @@ class AdaptiveController : public IController {

void update_goals()
{
const auto& mode = goal_->getGoalMode();
const auto& mode = goal_->getGoalMode();
const auto& value = goal_->getGoalValue();

for (int i = 0; i < 12; i++)
Expand All @@ -189,87 +189,87 @@ class AdaptiveController : public IController {
}
int count1 = 0, count2 = 0, count3 = 0, count4 = 0;

for (unsigned int axis = 0; axis < Axis4r::AxisCount(); ++axis)
{
for (unsigned int axis = 0; axis < Axis4r::AxisCount(); ++axis)
{
switch (mode[axis])
{
case GoalModeType::AngleRate:

switch (count1)
{
case 0:
reference[11] = value[axis];
break;
case 1:
reference[9] = value[axis];
break;
case 2:
reference[10] = value[axis];
break;
}
count1++;
break;
case GoalModeType::AngleLevel:

switch (count2)
{
case 0:
if (axis == 2)
{
reference[8] = value[axis];
}
else
{
reference[6] = value[axis];
}
break;
case 1:
reference[7] = -value[axis];
break;
case 2:
reference[8] = value[axis];
break;
}
count2++;
break;
case GoalModeType::VelocityWorld:

switch (count3)
{
case 0:
reference[3] = value[axis];
break;
case 1:
reference[4] = value[axis];
break;
case 2:
reference[5] = value[axis];
break;
}
count3++;
break;
case GoalModeType::PositionWorld:

switch (count4)
{
case 0:
if (axis != 0)
{
reference[2] = value[axis];
}
else
{
reference[0] = value[axis];
}
break;
case 1:
reference[1] = value[axis];
break;
case 2:
reference[2] = value[axis];
break;
}
count4++;
case GoalModeType::AngleRate:

switch (count1)
{
case 0:
reference[11] = value[axis];
break;
case 1:
reference[9] = value[axis];
break;
case 2:
reference[10] = value[axis];
break;
}
count1++;
break;
case GoalModeType::AngleLevel:

switch (count2)
{
case 0:
if (axis == 2)
{
reference[8] = value[axis];
}
else
{
reference[6] = value[axis];
}
break;
case 1:
reference[7] = -value[axis];
break;
case 2:
reference[8] = value[axis];
break;
}
count2++;
break;
case GoalModeType::VelocityWorld:

switch (count3)
{
case 0:
reference[3] = value[axis];
break;
case 1:
reference[4] = value[axis];
break;
case 2:
reference[5] = value[axis];
break;
}
count3++;
break;
case GoalModeType::PositionWorld:

switch (count4)
{
case 0:
if (axis != 0)
{
reference[2] = value[axis];
}
else
{
reference[0] = value[axis];
}
break;
case 1:
reference[1] = value[axis];
break;
case 2:
reference[2] = value[axis];
break;
}
count4++;
break;
default:

Expand Down

0 comments on commit 03e977f

Please sign in to comment.