Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CORRECTED: Now able to set timing for HITLControlLaw via IPC

  • Loading branch information...
commit f112f614b8fe1e9808bee52cc250c585350ef25b 1 parent 65c7f97
Sean Sketch authored
View
4 src/BelugaConstants.h
@@ -28,8 +28,8 @@ const unsigned int DEFAULT_H_THRESH_LOW = 10;
const unsigned int DEFAULT_S_THRESH_LOW = 0;
const unsigned int DEFAULT_S_THRESH_HIGH = 255;
-const double PI = 3.141592; // do I need this?
-const double DEFAULT_TANK_RADIUS = 3.2; // is this okay to do?
+const double PI = 3.141592;
+const double DEFAULT_TANK_RADIUS = 3.2;
const double DEFAULT_WATER_DEPTH = 2.286;
/* tank radius in m, need not be the actual tank radius,
View
10 src/BelugaControl.cpp
@@ -156,7 +156,7 @@ mt_dVector_t BelugaLowLevelControlLaw::doControl(const mt_dVector_t& state,
double u_steer = (K_omega/(K_d1*speed_normalization_factor*r_1))*u_turn;
double u_vthrust = 0;
- if(u_vert != 0.0)
+ if (u_vert != 0.0)
{
/* need z in the vertical thrust controller */
double z = state[BELUGA_STATE_Z];
@@ -178,21 +178,21 @@ mt_dVector_t BelugaLowLevelControlLaw::doControl(const mt_dVector_t& state,
double r_down = r_up; // same
/* can only calculate the determinant part if D > 0 */
- if(D_up > 0)
+ if (D_up > 0)
{
r_up += 0.25*sqrt(D_up);
}
- if(D_down > 0)
+ if (D_down > 0)
{
r_down += 0.25*sqrt(D_down);
}
/* note we favor up control if both have solutions */
- if(D_down > 0)
+ if (D_down > 0)
{
u_vthrust = -r_down;
}
- if(D_up > 0)
+ if (D_up > 0)
{
u_vthrust = r_up;
}
View
3  src/BelugaTrackerGUI.cpp
@@ -425,9 +425,10 @@ void BelugaTrackerFrame::doIPCExchange()
r &= m_IPCClient.getControls(robots, &mode, &X, &Y, &Z);
// set timing parameter for HITLControlLaw (m_dTiming) from IPC
+ double timing = 0;
std::string params("");
r &= m_IPCClient.getParams(&params);
- double timing = parseParamString(params);
+ sscanf(params.c_str(), "%f", &timing);
for(unsigned int i = 0; i < 4; i++)
{
m_apHITLController[i]->m_dTiming = timing;
Please sign in to comment.
Something went wrong with that request. Please try again.