Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d189b186 authored by nfoy's avatar nfoy
Browse files

Merge branch 'release-1.2.1-bugfixes' of...

Merge branch 'release-1.2.1-bugfixes' of git+ssh://scm.gforge.inria.fr/gitroot/openvibe/openvibe into release-1.2.1-bugfixes
parents 1b38283c 9d7470ff
No related branches found
No related tags found
No related merge requests found
......@@ -253,8 +253,9 @@ bool CImpactApplication::enemyDestroyed(CImpactEnemyShip* es)
void CImpactApplication::calculateFeedback(int iChannelCount, double *pChannel)
{
const int l_iNChannels = 3;
static int l_iSkipControl = 0;
static int l_vPreviousLevels[3] = {0, 0, 0};
static int l_vPreviousLevels[l_iNChannels] = { 0, 0, 0 };
if (l_iSkipControl < 2)
{
......@@ -266,29 +267,45 @@ void CImpactApplication::calculateFeedback(int iChannelCount, double *pChannel)
l_iSkipControl = 0;
}
double l_vFeedback[l_iNChannels];
if (iChannelCount == 6)
{
// Assume input is layered like [prob1pos,prop1neg,prop2pos,prop2neg,prop3pos,prop3neg];
l_vFeedback[0] = pChannel[0];
l_vFeedback[1] = pChannel[2];
l_vFeedback[2] = pChannel[4];
}
else if (iChannelCount == 3)
{
// Assume input is layered like [prob1,prob2,prob3]
l_vFeedback[0] = pChannel[0];
l_vFeedback[1] = pChannel[1];
l_vFeedback[2] = pChannel[2];
}
else
{
this->getLogManager() << LogLevel_Error << "Incorrect analog VRPN input with " << iChannelCount << " channels. This will not work.\n";
l_vFeedback[0] = 0;
l_vFeedback[1] = 0;
l_vFeedback[2] = 0;
}
if (m_poAdvancedControl != NULL)
{
m_poAdvancedControl->processFrame(pChannel[0], pChannel[1], pChannel[2]);
m_poAdvancedControl->processFrame(l_vFeedback[0], l_vFeedback[1], l_vFeedback[2]);
}
int l_vLevel[3];
// @FIXME bad, modifying non-ref input parameter
if(iChannelCount!=3) {
getLogManager() << LogLevel_Warning << "Changing iChannelCount from " << iChannelCount << " to 3\n";
}
iChannelCount = 3;
int l_vLevel[l_iNChannels];
//std::cout << "feedback: ";
for (int i = 0; i < iChannelCount; i++)
for (int i = 0; i < l_iNChannels; i++)
{
if (pChannel[i] > m_pMaxFeedbackLevel[i])
if (l_vFeedback[i] > m_pMaxFeedbackLevel[i])
{
m_pMaxFeedbackLevel[i] += 0.1;
}
float64 l_f64CLevel = pChannel[i] / m_pMaxFeedbackLevel[i];
float64 l_f64CLevel = l_vFeedback[i] / m_pMaxFeedbackLevel[i];
//std::cout << cLevel << ", ";
l_vLevel[i] = 0;
......
<OpenViBE-Scenario>
<Creator>OpenViBE</Creator>
<CreatorVersion>1.1.0+git</CreatorVersion>
<CreatorVersion>1.2.1+git</CreatorVersion>
<Boxes>
<Box>
<Identifier>(0x00000950, 0x0000088b)</Identifier>
......@@ -132,7 +132,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>65</Value>
<Value>43</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -144,7 +144,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>146</Value>
<Value>134</Value>
</Attribute>
<Attribute>
<Identifier>(0xce18836a, 0x9c0eb403)</Identifier>
......@@ -186,7 +186,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>65</Value>
<Value>43</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -198,7 +198,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>145</Value>
<Value>135</Value>
</Attribute>
<Attribute>
<Identifier>(0xce18836a, 0x9c0eb403)</Identifier>
......@@ -237,7 +237,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>31</Value>
<Value>23</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -249,7 +249,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>103</Value>
<Value>95</Value>
</Attribute>
<Attribute>
<Identifier>(0xc46b3d00, 0x3e0454e1)</Identifier>
......@@ -292,7 +292,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -312,7 +312,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>69</Value>
<Value>59</Value>
</Attribute>
<Attribute>
<Identifier>(0xc46b3d00, 0x3e0454e1)</Identifier>
......@@ -363,7 +363,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>31</Value>
<Value>23</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -375,7 +375,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>135</Value>
<Value>132</Value>
</Attribute>
<Attribute>
<Identifier>(0xc80ce8af, 0xf699f813)</Identifier>
......@@ -458,7 +458,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>31</Value>
<Value>23</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -470,7 +470,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>110</Value>
<Value>105</Value>
</Attribute>
<Attribute>
<Identifier>(0xc46b3d00, 0x3e0454e1)</Identifier>
......@@ -521,7 +521,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -533,7 +533,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>148</Value>
<Value>147</Value>
</Attribute>
<Attribute>
<Identifier>(0xc46b3d00, 0x3e0454e1)</Identifier>
......@@ -573,7 +573,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -593,7 +593,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>88</Value>
<Value>82</Value>
</Attribute>
<Attribute>
<Identifier>(0xc80ce8af, 0xf699f813)</Identifier>
......@@ -659,7 +659,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -679,7 +679,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>123</Value>
<Value>120</Value>
</Attribute>
<Attribute>
<Identifier>(0xc73e83ec, 0xf855c5bc)</Identifier>
......@@ -731,7 +731,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -751,7 +751,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>88</Value>
<Value>82</Value>
</Attribute>
<Attribute>
<Identifier>(0xc80ce8af, 0xf699f813)</Identifier>
......@@ -824,7 +824,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>65</Value>
<Value>43</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -883,7 +883,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -895,7 +895,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>134</Value>
<Value>120</Value>
</Attribute>
<Attribute>
<Identifier>(0xc80ce8af, 0xf699f813)</Identifier>
......@@ -949,7 +949,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>48</Value>
<Value>33</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -965,7 +965,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>159</Value>
<Value>153</Value>
</Attribute>
<Attribute>
<Identifier>(0xc46b3d00, 0x3e0454e1)</Identifier>
......@@ -1017,7 +1017,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>31</Value>
<Value>23</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -1029,7 +1029,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>142</Value>
<Value>138</Value>
</Attribute>
<Attribute>
<Identifier>(0xc73e83ec, 0xf855c5bc)</Identifier>
......@@ -1114,7 +1114,7 @@
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>31</Value>
<Value>23</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
......@@ -1126,11 +1126,7 @@
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>129</Value>
</Attribute>
<Attribute>
<Identifier>(0xc67a01dc, 0x28ce06c1)</Identifier>
<Value></Value>
<Value>125</Value>
</Attribute>
<Attribute>
<Identifier>(0xc73e83ec, 0xf855c5bc)</Identifier>
......@@ -1161,7 +1157,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1169,7 +1165,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1177,6 +1173,35 @@
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x0000044c, 0x00004e17)</Identifier>
<Source>
<BoxIdentifier>(0x3fa25161, 0x1ac039f6)</BoxIdentifier>
<BoxOutputIndex>2</BoxOutputIndex>
</Source>
<Target>
<BoxIdentifier>(0x00000b95, 0x00002a04)</BoxIdentifier>
<BoxInputIndex>0</BoxInputIndex>
</Target>
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>578</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
<Value>271</Value>
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>278</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
<Value>496</Value>
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x00000a6c, 0x00003766)</Identifier>
<Source>
......@@ -1190,7 +1215,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1198,7 +1223,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1219,7 +1244,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1227,7 +1252,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1248,7 +1273,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>230</Value>
<Value>226</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1256,7 +1281,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>227</Value>
<Value>235</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1277,7 +1302,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1285,7 +1310,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>-20</Value>
<Value>-16</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1306,7 +1331,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1314,7 +1339,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1322,6 +1347,35 @@
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x0000311c, 0x00001a36)</Identifier>
<Source>
<BoxIdentifier>(0x3fa25161, 0x1ac039f6)</BoxIdentifier>
<BoxOutputIndex>2</BoxOutputIndex>
</Source>
<Target>
<BoxIdentifier>(0x5e04ee28, 0x7aa4e1bb)</BoxIdentifier>
<BoxInputIndex>1</BoxInputIndex>
</Target>
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>578</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
<Value>271</Value>
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>672</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
<Value>327</Value>
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x000038e6, 0x00002eba)</Identifier>
<Source>
......@@ -1335,7 +1389,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1343,7 +1397,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1364,7 +1418,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>446</Value>
<Value>439</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1372,7 +1426,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>451</Value>
<Value>459</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1393,7 +1447,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>390</Value>
<Value>386</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1401,7 +1455,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>387</Value>
<Value>395</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1422,7 +1476,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>286</Value>
<Value>279</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1430,7 +1484,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>291</Value>
<Value>299</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1451,7 +1505,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>94</Value>
<Value>87</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1459,7 +1513,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>91</Value>
<Value>102</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1480,7 +1534,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1488,7 +1542,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>203</Value>
<Value>214</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1509,7 +1563,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>22</Value>
<Value>18</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1517,7 +1571,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>35</Value>
<Value>43</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1538,7 +1592,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-114</Value>
<Value>-121</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1546,7 +1600,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>-109</Value>
<Value>-101</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1567,7 +1621,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>167</Value>
<Value>156</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1575,7 +1629,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>188</Value>
<Value>192</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1596,7 +1650,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>350</Value>
<Value>343</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1604,7 +1658,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>348</Value>
<Value>352</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1625,7 +1679,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-114</Value>
<Value>-121</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1633,7 +1687,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>-109</Value>
<Value>-101</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1641,35 +1695,6 @@
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x46d65554, 0x6b15913e)</Identifier>
<Source>
<BoxIdentifier>(0x3fa25161, 0x1ac039f6)</BoxIdentifier>
<BoxOutputIndex>1</BoxOutputIndex>
</Source>
<Target>
<BoxIdentifier>(0x00000b95, 0x00002a04)</BoxIdentifier>
<BoxInputIndex>0</BoxInputIndex>
</Target>
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>582</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
<Value>256</Value>
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>267</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
<Value>496</Value>
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x5f696acf, 0x60799220)</Identifier>
<Source>
......@@ -1683,7 +1708,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>510</Value>
<Value>503</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1691,7 +1716,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>540</Value>
<Value>544</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1699,35 +1724,6 @@
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x6d4fd32f, 0x551eddc9)</Identifier>
<Source>
<BoxIdentifier>(0x3fa25161, 0x1ac039f6)</BoxIdentifier>
<BoxOutputIndex>1</BoxOutputIndex>
</Source>
<Target>
<BoxIdentifier>(0x5e04ee28, 0x7aa4e1bb)</BoxIdentifier>
<BoxInputIndex>1</BoxInputIndex>
</Target>
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>582</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
<Value>256</Value>
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>668</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
<Value>327</Value>
</Attribute>
</Attributes>
</Link>
<Link>
<Identifier>(0x6fa85c67, 0x49dcd1cc)</Identifier>
<Source>
......@@ -1741,7 +1737,7 @@
<Attributes>
<Attribute>
<Identifier>(0x1b32c44c, 0x1905e0e9)</Identifier>
<Value>-50</Value>
<Value>-57</Value>
</Attribute>
<Attribute>
<Identifier>(0x358ae8b5, 0x0f8bacd1)</Identifier>
......@@ -1749,7 +1745,7 @@
</Attribute>
<Attribute>
<Identifier>(0x3f0a3b27, 0x570913d2)</Identifier>
<Value>668</Value>
<Value>672</Value>
</Attribute>
<Attribute>
<Identifier>(0x6267b5c5, 0x676e3e42)</Identifier>
......@@ -1782,7 +1778,7 @@ computed by the classifier (distance to LDA hyperplane).</Text>
</Comment>
<Comment>
<Identifier>(0x000035fc, 0x000020af)</Identifier>
<Text>Please note that the feedback is starting near &lt;b&gt;40'&lt;/b&gt;</Text>
<Text>Please note that the feedback is starting near &lt;b&gt;40s&lt;/b&gt;</Text>
<Attributes>
<Attribute>
<Identifier>(0x473d9a43, 0x97fc0a97)</Identifier>
......@@ -1801,6 +1797,8 @@ computed by the classifier (distance to LDA hyperplane).</Text>
This scenario allows to quickly replay
an online session recorded file, and watch the corresponding
feedback using the &lt;b&gt;openvibe-vr-demo-handball&lt;/b&gt;.
Please launch it manually.
This scenario is based on &lt;i&gt;motor-imagery-bci-4-replay&lt;/i&gt;,
which can be found in &lt;i&gt;bci/motor-imagery&lt;/i&gt;.
It uses &lt;b&gt;VRPN servers&lt;/b&gt; to communicate with the handball application.
......
<OpenViBE-Classifier-Box XMLVersion="3">
<OpenViBE-Classifier-Box Creator="OpenViBE" CreatorVersion="1.2.1+git" FormatVersion="4">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="1">OVTK_GDF_Left</Class-Stimulation>
<Class-Stimulation class-id="2">OVTK_GDF_Right</Class-Stimulation>
<Class-Stimulation class-id="0">OVTK_GDF_Left</Class-Stimulation>
<Class-Stimulation class-id="1">OVTK_GDF_Right</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA>
<Classes>1 2</Classes>
<Weights>4.852093e+00 -5.293004e+00</Weights>
<Bias-distance>1.228474e+00</Bias-distance>
<Coefficient-probability>1.228474e+00</Coefficient-probability>
<LDA version="1">
<Classes>0 1 </Classes>
<Class-config-list>
<Class-config>
<Weights> 2.318337e+001 1.028989e+001</Weights>
<Bias>-26.1985</Bias>
</Class-config>
<Class-config>
<Weights> 2.036666e+001 1.336324e+001</Weights>
<Bias>-27.024</Bias>
</Class-config>
</Class-config-list>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
\ No newline at end of file
......@@ -157,8 +157,12 @@ bool CHandballBCI::process(double timeSinceLastProcess)
{
std::list < double >& l_rVrpnAnalogState=m_poVrpnPeripheral->m_vAnalog.front();
//we take the last value from the server
double l_dAnalog=*(l_rVrpnAnalogState.begin());
//we take the last value from the server.
// The input is a probability [0,1] for the left class, map it to [-1,1] to indicate [left,right] range
double l_dAnalog = (*l_rVrpnAnalogState.begin());
l_dAnalog = 2.0*(-l_dAnalog) + 1.0;
// std::cout << "list size" << l_rVrpnAnalogState.size() << " head " << l_dAnalog << "\n";
//we updtae the max and min values
// A. VLG : we should compute the min/max only in the ACTIVE phase
......@@ -218,9 +222,9 @@ bool CHandballBCI::process(double timeSinceLastProcess)
{
case Phase_Rest:
std::cout << "### PHASE REST ###" <<std::endl;
if(m_iLastMark==Mark_Left && m_fBallPosition<0) { m_iLeftScore++;}
if(m_iLastMark==Mark_Right&& m_fBallPosition>0) { m_iRightScore++;}
if(m_iLastMark==Mark_Left && m_fBallPosition>0) { m_iLeftScore++;}
if(m_iLastMark==Mark_Right&& m_fBallPosition<0) { m_iRightScore++;}
std::cout << "- Current Score: " <<std::endl;
std::cout << "--- GOAL: " <<m_iGoalScore<<"/"<<(m_iTrialRightCount+m_iTrialLeftCount)<<std::endl;
std::cout << "--- LEFT: " <<m_iLeftScore<<"/"<<m_iTrialLeftCount<<std::endl;
......@@ -254,6 +258,8 @@ bool CHandballBCI::process(double timeSinceLastProcess)
l_poPassiveBallPivot->setVisible(false);
l_poActiveBallPivot->setVisible(false);
m_bGoalMarkedAtThisPhase = false;
break;
......@@ -293,8 +299,8 @@ bool CHandballBCI::process(double timeSinceLastProcess)
case Phase_Active:
m_fBallSpeed=-(float)(m_dFeedback * 0.1);
if(m_iMark==Mark_Left && m_fBallPosition==-GOAL_DISTANCE && !m_bGoalMarkedAtThisPhase) { m_iGoalScore++; m_bGoalMarkedAtThisPhase=true; }
if(m_iMark==Mark_Right&& m_fBallPosition== GOAL_DISTANCE && !m_bGoalMarkedAtThisPhase) { m_iGoalScore++; m_bGoalMarkedAtThisPhase=true; }
if(m_iMark==Mark_Left && m_fBallPosition>= GOAL_DISTANCE && !m_bGoalMarkedAtThisPhase) { m_iGoalScore++; m_bGoalMarkedAtThisPhase=true; }
if(m_iMark==Mark_Right&& m_fBallPosition<= -GOAL_DISTANCE && !m_bGoalMarkedAtThisPhase) { m_iGoalScore++; m_bGoalMarkedAtThisPhase=true; }
if(m_iMark==Mark_Left && m_dFeedback<0) { m_iClassificationScore++;}
if(m_iMark==Mark_Right&& m_dFeedback>0) { m_iClassificationScore++;}
......
......@@ -60,7 +60,7 @@ namespace OpenViBEVRDemos {
bool m_bGoalMarkedAtThisPhase;
float m_fBallSpeed;
float m_fBallPosition;
float m_fBallPosition; // n.b. The coordinate system of this seems to be inverted wrt the [-left,+right] convention
float m_fLastBallPosition;
float m_fBallOrientation;
......
......@@ -24,18 +24,18 @@ ENDIF(WIN32)
IF(UNIX)
INCLUDE("FindPkgConfig")
SET(CEGUI_FOUND "-NOTFOUND")
pkg_check_modules(CEGUI CEGUI)
pkg_check_modules(CEGUI QUIET CEGUI)
IF(NOT CEGUI_FOUND)
# we have this mess as the cegui filenames & paths are different on Fedora 21 at least,
# and the include_dirs doesn't contain the CEGUI/ part ... I'd put that to the .h/.cpp IF the same path
# convention was the case on all platforms... but it is not
pkg_check_modules(CEGUI CEGUI-0)
pkg_check_modules(CEGUI QUIET CEGUI-0)
SET(CEGUI_INCLUDE_DIRS "${CEGUI_INCLUDE_DIRS}/CEGUI")
ENDIF(NOT CEGUI_FOUND)
SET(OgreCEGUIRenderer_FOUND "-NOTFOUND")
pkg_check_modules(OgreCEGUIRenderer CEGUI-OGRE)
pkg_check_modules(OgreCEGUIRenderer QUIET CEGUI-OGRE)
IF(NOT OgreCEGUIRenderer_FOUND)
pkg_check_modules(OgreCEGUIRenderer CEGUI-0-OGRE)
pkg_check_modules(OgreCEGUIRenderer QUIET CEGUI-0-OGRE)
ENDIF(NOT OgreCEGUIRenderer_FOUND)
ENDIF(UNIX)
......
......@@ -14,6 +14,7 @@
#include <boost/thread.hpp>
#include <boost/thread/condition.hpp>
#include <boost/version.hpp>
#include <boost/scoped_ptr.hpp>
#include <sys/timeb.h>
......
......@@ -6,6 +6,7 @@
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/config.hpp>
#include <boost/scoped_ptr.hpp>
using namespace std;
......
......@@ -350,23 +350,68 @@ echo ""
## ##
####################################
version_greater() {
expr "$1" = "`echo -e "$1\n$2" | sort -n | tail -n1`" 2>/dev/null
}
if [[ ! -e "$ov_target_folder_hit/no-native-packages.hit" ]]; then
echo "Checking native dependencies..."
if [[ "`grep -E 'Ubuntu|LinuxMint' /etc/lsb-release 2> /dev/null`" != "" || "`grep -E 'Raspbian' /etc/os-release 2> /dev/null`" != "" || "`grep Debian /etc/issue 2> /dev/null`" != "" ]]; then
[[ -z `grep -E 'Debian' /etc/issue 2> /dev/null` ]] ; is_debian=$?
[[ -z `grep -E 'Ubuntu' /etc/lsb-release 2> /dev/null` ]] ; is_ubuntu=$?
[[ -z `grep -E 'LinuxMint' /etc/lsb-release 2> /dev/null` ]] ; is_mint=$?
[[ -z `grep -E 'Raspbian' /etc/os-release 2> /dev/null` ]] ; is_raspbian=$?
if [[ $is_debian -eq 1 || $is_ubuntu -eq 1 || $is_raspbian -eq 1 || $is_mint -eq 1 ]]; then
echo " You are currently running a Debian/Ubuntu based distribution"
ov_native_package_installed=true
ov_native_package_log_file="$ov_target_folder_log/native-packages.log"
ov_ubuntu_version=`lsb_release -r -s 2>/dev/null`
if [[ `expr $ov_ubuntu_version \>= 14.04` == 1 ]]; then
# at the time of writing this, there was a conflict between libogre-dev and libboost-thread-dev dependencies in 13.10 and 14.04
echo " Ubuntu $ov_ubuntu_version detected, suggesting specific set of packages..."
ov_lib_ogre_dev=libogre-1.8-dev
ov_lib_libboost_chrono_dev=libboost-chrono1.54-dev
else
ov_distro_version=`lsb_release -r -s 2>/dev/null`
echo " Found distro version $ov_distro_version ..."
# Different distros and versions might need slightly different packages
if [[ $is_ubuntu -eq 1 ]]; then
if [[ `version_greater $ov_distro_version 16.04` == 1 ]]; then
echo " Ubuntu >= v16.04 detected, guessing specific set of packages..."
ov_lib_ogre_dev=libogre-1.9-dev
ov_lib_libboost_chrono_dev=libboost-chrono1.58-dev
elif [[ `version_greater $ov_distro_version 14.04` == 1 ]]; then
echo " Ubuntu >= v14.04 detected, guessing specific set of packages..."
ov_lib_ogre_dev=libogre-1.8-dev
ov_lib_libboost_chrono_dev=libboost-chrono1.54-dev
else
echo " Ubuntu seems older than v14.04 ..."
ov_lib_ogre_dev=libogre-dev
ov_lib_libboost_chrono_dev=
fi;
fi;
if [[ $is_debian -eq 1 ]]; then
if [[ `version_greater $ov_distro_version 8` == 1 ]]; then
echo " Debian >= v8 detected, guessing specific set of packages..."
# although 1.9 is available, it doesn't seem to play well together with cegui, so we use 1.8 ...
ov_lib_ogre_dev=libogre-1.8-dev
ov_lib_libboost_chrono_dev=libboost-chrono1.55-dev
else
echo " Debian seems older than v8 ..."
ov_lib_ogre_dev=libogre-dev
ov_lib_libboost_chrono_dev=
fi
fi;
if [[ $is_mint -eq 1 ]]; then
# hack the correct versions here...
echo " Mint detected, guessing specific set of packages..."
ov_lib_ogre_dev=libogre-dev
ov_lib_libboost_chrono_dev=
fi;
fi
if [[ $is_raspbian -eq 1 ]]; then
# hack the correct versions here...
echo " Raspbian detected, guessing specific set of packages..."
ov_lib_ogre_dev=libogre-dev
ov_lib_libboost_chrono_dev=
fi
ov_ubuntu_packages="wget doxygen make automake autoconf cmake unzip gcc g++ libgtk2.0-dev libglade2-dev gfortran libgsl0-dev libexpat1-dev libreadline-dev libzzip-dev libtool libxaw7-dev libpcre3-dev libfreeimage-dev libglu1-mesa-dev libalut-dev libvorbis-dev libncurses5-dev python-dev python-numpy libeigen3-dev $ov_lib_ogre_dev libcegui-mk2-dev libois-dev libboost-dev libboost-thread-dev liblua5.1-0-dev libboost-regex-dev libboost-filesystem-dev $ov_lib_libboost_chrono_dev libitpp-dev sqlite libsqlite0-dev libfftw3-dev"
for package in $ov_ubuntu_packages; do
......@@ -382,7 +427,6 @@ if [[ ! -e "$ov_target_folder_hit/no-native-packages.hit" ]]; then
done;
if [[ $ov_native_package_installed == false ]]; then
echo " You are currently running a Debian/Ubuntu based distribution"
echo ""
echo " Root access is required to install needed packages."
echo ""
......@@ -521,7 +565,7 @@ ov_package_url_itpp=http://openvibe.inria.fr/dependencies/linux-x86/itpp-4.0.7.t
ov_package_url_vrpn=http://openvibe.inria.fr/dependencies/linux-x86/vrpn_07_31-ov.zip
# LabStreamingLayer
ov_package_url_liblsl=http://openvibe.inria.fr/dependencies/linux-x86/liblsl-1.04-src.tar.bz2
ov_package_url_liblsl=http://openvibe.inria.fr/dependencies/linux-x86/liblsl-1.04.ov1-src.tar.bz2
##############################################
## ##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment