mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Tango: Fixed auto-exposure config error (now ignoring it), updated log info
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<!-- BEGIN_INCLUDE(manifest) -->
|
<!-- BEGIN_INCLUDE(manifest) -->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.introlab.rtabmap"
|
package="com.introlab.rtabmap"
|
||||||
android:versionCode="2"
|
android:versionCode="4"
|
||||||
android:versionName="@RTABMAP_VERSION@">
|
android:versionName="@RTABMAP_VERSION@">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|||||||
@@ -144,28 +144,31 @@ bool CameraTango::init(const std::string & calibrationFolder, const std::string
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable auto exposure
|
// disable auto exposure (disabled, seems broken on latest Tango releases)
|
||||||
ret = TangoConfig_setBool(tango_config_, "config_color_mode_auto", autoExposure_);
|
ret = TangoConfig_setBool(tango_config_, "config_color_mode_auto", autoExposure_);
|
||||||
if (ret != TANGO_SUCCESS)
|
if (ret != TANGO_SUCCESS)
|
||||||
{
|
{
|
||||||
LOGE("NativeRTABMap: config_color_mode_auto() failed with error code: %d", ret);
|
LOGE("NativeRTABMap: config_color_mode_auto() failed with error code: %d", ret);
|
||||||
return false;
|
//return false;
|
||||||
}
|
}
|
||||||
if(!autoExposure_)
|
else
|
||||||
{
|
{
|
||||||
ret = TangoConfig_setInt32(tango_config_, "config_color_iso", 800);
|
if(!autoExposure_)
|
||||||
if (ret != TANGO_SUCCESS)
|
|
||||||
{
|
{
|
||||||
LOGE("NativeRTABMap: config_color_iso() failed with error code: %d", ret);
|
ret = TangoConfig_setInt32(tango_config_, "config_color_iso", 800);
|
||||||
return false;
|
if (ret != TANGO_SUCCESS)
|
||||||
|
{
|
||||||
|
LOGE("NativeRTABMap: config_color_iso() failed with error code: %d", ret);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
bool verifyAutoExposureState;
|
||||||
|
int32_t verifyIso, verifyExp;
|
||||||
|
TangoConfig_getBool( tango_config_, "config_color_mode_auto", &verifyAutoExposureState );
|
||||||
|
TangoConfig_getInt32( tango_config_, "config_color_iso", &verifyIso );
|
||||||
|
TangoConfig_getInt32( tango_config_, "config_color_exp", &verifyExp );
|
||||||
|
LOGI( "NativeRTABMap: config_color autoExposure=%s %d %d", verifyAutoExposureState?"On" : "Off", verifyIso, verifyExp );
|
||||||
}
|
}
|
||||||
bool verifyAutoExposureState;
|
|
||||||
int32_t verifyIso, verifyExp;
|
|
||||||
TangoConfig_getBool( tango_config_, "config_color_mode_auto", &verifyAutoExposureState );
|
|
||||||
TangoConfig_getInt32( tango_config_, "config_color_iso", &verifyIso );
|
|
||||||
TangoConfig_getInt32( tango_config_, "config_color_exp", &verifyExp );
|
|
||||||
LOGI( "NativeRTABMap: config_color autoExposure=%s %d %d", verifyAutoExposureState?"On" : "Off", verifyIso, verifyExp );
|
|
||||||
|
|
||||||
// Enable depth.
|
// Enable depth.
|
||||||
ret = TangoConfig_setBool(tango_config_, "config_enable_depth", true);
|
ret = TangoConfig_setBool(tango_config_, "config_enable_depth", true);
|
||||||
|
|||||||
@@ -62,9 +62,10 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
|
|||||||
|
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpDetectorStrategy(), std::string("6"))); // GFTT/BRIEF
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpDetectorStrategy(), std::string("6"))); // GFTT/BRIEF
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kGFTTQualityLevel(), std::string("0.0001")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kGFTTQualityLevel(), std::string("0.0001")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kGFTTMinDistance(), std::string(fullResolution_?"15":"5")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemImagePreDecimation(), std::string(fullResolution_?"2":"1")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kFASTThreshold(), std::string("1")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kFASTThreshold(), std::string("1")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kBRIEFBytes(), std::string("64")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kBRIEFBytes(), std::string("64")));
|
||||||
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapTimeThr(), std::string("800")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemBinDataKept(), uBool2Str(!trajectoryMode_)));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemBinDataKept(), uBool2Str(!trajectoryMode_)));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemNotLinkedNodesKept(), std::string("false")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemNotLinkedNodesKept(), std::string("false")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerIterations(), graphOptimization_?"10":"0"));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerIterations(), graphOptimization_?"10":"0"));
|
||||||
|
|||||||
@@ -82,10 +82,15 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
private int mMeshTriangleSizeIndex = 0;
|
private int mMeshTriangleSizeIndex = 0;
|
||||||
|
|
||||||
private int mParamUpdateRateHzIndex = 1;
|
private int mParamUpdateRateHzIndex = 1;
|
||||||
private int mParamTimeThrMsIndex = 1;
|
private int mParamTimeThrMsIndex = 4;
|
||||||
private int mParamMaxFeaturesIndex = 4;
|
private int mParamMaxFeaturesIndex = 4;
|
||||||
private int mParamLoopThrMsIndex = 1;
|
private int mParamLoopThrMsIndex = 1;
|
||||||
|
|
||||||
|
final String[] mUpdateRateValues = {"0.5", "1", "2", "Max"};
|
||||||
|
final String[] mTimeThrValues = {"400", "500", "600", "700", "800", "900", "1000", "1100", "1200", "1300", "1400", "1500", "No Limit"};
|
||||||
|
final String[] mMaxFeaturesValues = {"Disabled", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "No Limit"};
|
||||||
|
final String[] mLoopThrValues = {"Disabled", "0.11", "0.20", "0.30", "0.40", "0.50", "0.60", "0.70", "0.80", "0.90"};
|
||||||
|
|
||||||
private LinearLayout mLayoutDebug;
|
private LinearLayout mLayoutDebug;
|
||||||
|
|
||||||
private int mTotalLoopClosures = 0;
|
private int mTotalLoopClosures = 0;
|
||||||
@@ -313,7 +318,7 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
{
|
{
|
||||||
if(mItemPause!=null)
|
if(mItemPause!=null)
|
||||||
{
|
{
|
||||||
((TextView)findViewById(R.id.status)).setText(mItemPause.isChecked()?"Paused":mItemLocalizationMode.isChecked()?"Localization":"Mapping");
|
((TextView)findViewById(R.id.status)).setText(mItemPause.isChecked()?"Paused":mItemLocalizationMode.isChecked()?String.format("Localization (%s Hz)", mUpdateRateValues[mParamUpdateRateHzIndex]):String.format("Mapping (%s Hz)", mUpdateRateValues[mParamUpdateRateHzIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
((TextView)findViewById(R.id.points)).setText(String.valueOf(points));
|
((TextView)findViewById(R.id.points)).setText(String.valueOf(points));
|
||||||
@@ -323,9 +328,9 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
((TextView)findViewById(R.id.memory)).setText(String.valueOf(Debug.getNativeHeapAllocatedSize()/(1024*1024)));
|
((TextView)findViewById(R.id.memory)).setText(String.valueOf(Debug.getNativeHeapAllocatedSize()/(1024*1024)));
|
||||||
((TextView)findViewById(R.id.db_size)).setText(String.valueOf(databaseMemoryUsed));
|
((TextView)findViewById(R.id.db_size)).setText(String.valueOf(databaseMemoryUsed));
|
||||||
((TextView)findViewById(R.id.inliers)).setText(String.valueOf(inliers));
|
((TextView)findViewById(R.id.inliers)).setText(String.valueOf(inliers));
|
||||||
((TextView)findViewById(R.id.features)).setText(String.valueOf(featuresExtracted));
|
((TextView)findViewById(R.id.features)).setText(String.format("%d / %s", featuresExtracted, mMaxFeaturesValues[mParamMaxFeaturesIndex]));
|
||||||
((TextView)findViewById(R.id.update_time)).setText(String.format("%.3f", updateTime));
|
((TextView)findViewById(R.id.update_time)).setText(String.format("%.3f / %s", updateTime, mTimeThrValues[mParamTimeThrMsIndex]));
|
||||||
((TextView)findViewById(R.id.hypothesis)).setText(String.format("%.3f (%d)", hypothesis, loopClosureId));
|
((TextView)findViewById(R.id.hypothesis)).setText(String.format("%.3f / %s (%d)", hypothesis, mLoopThrValues[mParamLoopThrMsIndex], loopClosureId));
|
||||||
if(loopClosureId > 0)
|
if(loopClosureId > 0)
|
||||||
{
|
{
|
||||||
++mTotalLoopClosures;
|
++mTotalLoopClosures;
|
||||||
@@ -807,15 +812,14 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
// get double
|
// get double
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("Update Rate (Hz)");
|
builder.setTitle("Update Rate (Hz)");
|
||||||
final String[] values = {"0.5", "1", "2", "Max"};
|
builder.setSingleChoiceItems(mUpdateRateValues, mParamUpdateRateHzIndex, new DialogInterface.OnClickListener() {
|
||||||
builder.setSingleChoiceItems(values, mParamUpdateRateHzIndex, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(which >=0 && which < 4)
|
if(which >=0 && which < mUpdateRateValues.length)
|
||||||
{
|
{
|
||||||
mParamUpdateRateHzIndex = which;
|
mParamUpdateRateHzIndex = which;
|
||||||
if(RTABMapLib.setMappingParameter("Rtabmap/DetectionRate", values[which]) != 0)
|
if(RTABMapLib.setMappingParameter("Rtabmap/DetectionRate", mUpdateRateValues[which]) != 0)
|
||||||
{
|
{
|
||||||
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/DetectionRate\"!", mToast.LENGTH_LONG).show();
|
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/DetectionRate\"!", mToast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
@@ -829,15 +833,14 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
// get double
|
// get double
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("Time Threshold (ms)");
|
builder.setTitle("Time Threshold (ms)");
|
||||||
final String[] values = {"400", "700", "1400", "No Limit"};
|
builder.setSingleChoiceItems(mTimeThrValues, mParamTimeThrMsIndex, new DialogInterface.OnClickListener() {
|
||||||
builder.setSingleChoiceItems(values, mParamTimeThrMsIndex, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(which >=0 && which < 4)
|
if(which >=0 && which < mTimeThrValues.length)
|
||||||
{
|
{
|
||||||
mParamTimeThrMsIndex = which;
|
mParamTimeThrMsIndex = which;
|
||||||
if(RTABMapLib.setMappingParameter("Rtabmap/TimeThr", which==3?"0":values[which]) != 0)
|
if(RTABMapLib.setMappingParameter("Rtabmap/TimeThr", which==mTimeThrValues.length-1?"0":mTimeThrValues[which]) != 0)
|
||||||
{
|
{
|
||||||
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/TimeThr\"!", mToast.LENGTH_LONG).show();
|
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/TimeThr\"!", mToast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
@@ -851,15 +854,14 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
// get double
|
// get double
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("Max Features");
|
builder.setTitle("Max Features");
|
||||||
final String[] values = {"Disabled", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "No Limit"};
|
builder.setSingleChoiceItems(mMaxFeaturesValues, mParamMaxFeaturesIndex, new DialogInterface.OnClickListener() {
|
||||||
builder.setSingleChoiceItems(values, mParamMaxFeaturesIndex, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(which >=0 && which < 12)
|
if(which >=0 && which < mMaxFeaturesValues.length)
|
||||||
{
|
{
|
||||||
mParamMaxFeaturesIndex = which;
|
mParamMaxFeaturesIndex = which;
|
||||||
if(RTABMapLib.setMappingParameter("Kp/MaxFeatures", which==0?"-1":which==11?"0":values[which]) != 0)
|
if(RTABMapLib.setMappingParameter("Kp/MaxFeatures", which==0?"-1":which==mMaxFeaturesValues.length-1?"0":mMaxFeaturesValues[which]) != 0)
|
||||||
{
|
{
|
||||||
mToast.makeText(getActivity(),"Failed to set parameter \"Kp/MaxFeatures\"!", mToast.LENGTH_LONG).show();
|
mToast.makeText(getActivity(),"Failed to set parameter \"Kp/MaxFeatures\"!", mToast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
@@ -873,15 +875,14 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
|||||||
// get double
|
// get double
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("Loop Closure Threshold");
|
builder.setTitle("Loop Closure Threshold");
|
||||||
final String[] values = {"Disabled", "0.11", "0.20", "0.30", "0.40", "0.50", "0.60", "0.70", "0.80", "0.90"};
|
builder.setSingleChoiceItems(mLoopThrValues, mParamLoopThrMsIndex, new DialogInterface.OnClickListener() {
|
||||||
builder.setSingleChoiceItems(values, mParamTimeThrMsIndex, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(which >=0 && which < 10)
|
if(which >=0 && which < mLoopThrValues.length)
|
||||||
{
|
{
|
||||||
mParamLoopThrMsIndex = which;
|
mParamLoopThrMsIndex = which;
|
||||||
if(RTABMapLib.setMappingParameter("Rtabmap/LoopThr", which==0?"1":values[which]) != 0)
|
if(RTABMapLib.setMappingParameter("Rtabmap/LoopThr", which==0?"1":mLoopThrValues[which]) != 0)
|
||||||
{
|
{
|
||||||
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/LoopThr\"!", mToast.LENGTH_LONG).show();
|
mToast.makeText(getActivity(), "Failed to set parameter \"Rtabmap/LoopThr\"!", mToast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user