NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
- ComputedModelVersion "1.129"
+ ComputedModelVersion "1.131"
NumModelReferences 0
NumTestPointedSignals 0
}
ModifiedByFormat "%<Auto>"
LastModifiedBy "wsh"
ModifiedDateFormat "%<Auto>"
- LastModifiedDate "Wed Apr 30 02:08:24 2008"
- ModelVersionFormat "1.%<AutoIncrement:129>"
+ LastModifiedDate "Wed Apr 30 07:39:51 2008"
+ ModelVersionFormat "1.%<AutoIncrement:131>"
ConfigurationManager "None"
SimulationMode "normal"
LinearizationMsg "none"
System {
Name "Graphs"
Location [962, 152, 1482, 471]
- Open on
+ Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
- MaskValueString "3000|0.01|5/180*pi|1/180*pi"
+ MaskValueString "3000|0.01|5/180*pi|5/180*pi"
MaskTabNameString ",,,"
}
Block {
System {
Name "Rotating laser"
Location [651, 66, 1675, 656]
- Open off
+ Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
BlockType Sum
Name "Sum1"
Ports [2, 1]
- Position [415, 305, 435, 325]
+ Position [460, 305, 480, 325]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum2"
Ports [2, 1]
- Position [430, 375, 450, 395]
+ Position [445, 375, 465, 395]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum3"
Ports [2, 1]
- Position [445, 445, 465, 465]
+ Position [430, 445, 450, 465]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum4"
Ports [2, 1]
- Position [460, 515, 480, 535]
+ Position [415, 515, 435, 535]
ShowName off
IconShape "round"
Inputs "++|"
DstBlock "Rate Transition1"
DstPort 1
}
- Line {
- SrcBlock "Demux1"
- SrcPort 3
- DstBlock "Sum3"
- DstPort 1
- }
- Line {
- SrcBlock "Demux1"
- SrcPort 2
- DstBlock "Sum2"
- DstPort 1
- }
- Line {
- SrcBlock "Demux1"
- SrcPort 1
- DstBlock "Sum1"
- DstPort 1
- }
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Beacon Angles"
DstPort 1
}
- Line {
- SrcBlock "Demux"
- SrcPort 3
- Points [0, 81; 155, 0]
- DstBlock "Beacon memory"
- DstPort trigger
- }
- Line {
- SrcBlock "Demux"
- SrcPort 2
- Points [0, 149]
- DstBlock "Beacon memory1"
- DstPort trigger
- }
- Line {
- SrcBlock "Demux"
- SrcPort 1
- Points [0, 219]
- DstBlock "Beacon memory2"
- DstPort trigger
- }
Line {
SrcBlock "Beacon memory2"
SrcPort 1
DstPort 1
}
Branch {
- DstBlock "Sum4"
+ DstBlock "Sum1"
DstPort 1
}
}
DstBlock "Mux"
DstPort 4
}
+ Line {
+ SrcBlock "Demux"
+ SrcPort 4
+ Points [0, 79]
+ DstBlock "Beacon memory"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [0, 149]
+ DstBlock "Beacon memory1"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [0, 219]
+ DstBlock "Beacon memory2"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [0, 289]
+ DstBlock "Beacon memory3"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 3
+ DstBlock "Sum2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 2
+ DstBlock "Sum3"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 1
+ DstBlock "Sum4"
+ DstPort 1
+ }
}
}
Block {
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
low "0"
- gain "360"
+ gain "280.8"
high "360"
}
Block {
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
low "0"
- gain "0.7156"
+ gain "1.1656"
high "3"
}
Block {
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
- sw "1"
+ sw "0"
action "0"
varsize off
}
NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
- ComputedModelVersion "1.327"
+ ComputedModelVersion "1.329"
NumModelReferences 0
NumTestPointedSignals 0
}
ModifiedByFormat "%<Auto>"
LastModifiedBy "wsh"
ModifiedDateFormat "%<Auto>"
- LastModifiedDate "Wed Apr 30 02:09:53 2008"
- ModelVersionFormat "1.%<AutoIncrement:327>"
+ LastModifiedDate "Wed Apr 30 07:42:20 2008"
+ ModelVersionFormat "1.%<AutoIncrement:329>"
ConfigurationManager "None"
SimulationMode "normal"
LinearizationMsg "none"
}
System {
Name "reg_mcl"
- Location [666, 262, 1521, 739]
+ Location [118, 523, 973, 1000]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
System {
Name "Robot kinematics"
Location [4, 55, 1176, 412]
- Open on
+ Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
BlockType SubSystem
Name "Rotating laser"
Ports [1, 3]
- Position [430, 119, 575, 181]
+ Position [425, 119, 570, 181]
BackgroundColor "[0.912000, 0.763112, 0.484696]"
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
BlockType Sum
Name "Sum1"
Ports [2, 1]
- Position [415, 305, 435, 325]
+ Position [460, 305, 480, 325]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum2"
Ports [2, 1]
- Position [430, 375, 450, 395]
+ Position [445, 375, 465, 395]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum3"
Ports [2, 1]
- Position [445, 445, 465, 465]
+ Position [430, 445, 450, 465]
ShowName off
IconShape "round"
Inputs "++|"
BlockType Sum
Name "Sum4"
Ports [2, 1]
- Position [460, 515, 480, 535]
+ Position [415, 515, 435, 535]
ShowName off
IconShape "round"
Inputs "++|"
IconDisplay "Port number"
BusOutputAsStruct off
}
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 1
+ DstBlock "Sum4"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 2
+ DstBlock "Sum3"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 3
+ DstBlock "Sum2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [0, 289]
+ DstBlock "Beacon memory3"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [0, 219]
+ DstBlock "Beacon memory2"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [0, 149]
+ DstBlock "Beacon memory1"
+ DstPort trigger
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 4
+ Points [0, 79]
+ DstBlock "Beacon memory"
+ DstPort trigger
+ }
Line {
SrcBlock "Beacon memory3"
SrcPort 1
SrcPort 4
Points [0, 10]
Branch {
- DstBlock "Sum4"
+ DstBlock "Sum1"
DstPort 1
}
Branch {
DstBlock "Mux"
DstPort 3
}
- Line {
- SrcBlock "Demux"
- SrcPort 1
- Points [0, 219]
- DstBlock "Beacon memory2"
- DstPort trigger
- }
- Line {
- SrcBlock "Demux"
- SrcPort 2
- Points [0, 149]
- DstBlock "Beacon memory1"
- DstPort trigger
- }
- Line {
- SrcBlock "Demux"
- SrcPort 3
- Points [0, 81; 155, 0]
- DstBlock "Beacon memory"
- DstPort trigger
- }
Line {
SrcBlock "Pos"
SrcPort 1
DstBlock "Beacon memory"
DstPort 1
}
- Line {
- SrcBlock "Demux1"
- SrcPort 1
- DstBlock "Sum1"
- DstPort 1
- }
- Line {
- SrcBlock "Demux1"
- SrcPort 2
- DstBlock "Sum2"
- DstPort 1
- }
- Line {
- SrcBlock "Demux1"
- SrcPort 3
- DstBlock "Sum3"
- DstPort 1
- }
Line {
SrcBlock "Sum5"
SrcPort 1
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
- MaskValueString "path|desc.initpos|desc.wayconstraints|1"
+ MaskValueString "path|desc.initpos|desc.wayconstraints|3"
MaskTabNameString ",,,"
}
Block {
Line {
SrcBlock "Rotating laser"
SrcPort 2
- Points [15, 0]
+ Points [20, 0]
DstBlock "Switch"
DstPort 2
}
struct mcl_model *mcl = &l->mcl;
struct mcl_laser_measurement *last_angles = ssGetPWork(S)[1];
struct mcl_laser_state *parts = l->parts;
+ bool nonzero = false;
+ bool changed = false;
double *pos = ssGetOutputPortRealSignal(S,OUTPUT_EST_POS);
uint8_t *bitmap = ssGetOutputPortSignal(S,OUTPUT_BITMAP);
if (ssIsSampleHit(S, measureTid, tid)) {
struct mcl_laser_measurement angles;
int i;
- bool nonzero = false;
- bool changed = false;
/* ssPrintf("measure \n"); */
angles.count = iMeasureWidth;
}
/* Update probability bitmap */
- /* parts = l->resampled; */
- parts = l->parts;;
+ if (changed && nonzero)
+ parts = l->resampled; /* Draw particles before resampling */
+ else
+ parts = l->parts;;
for (i=0; i<BITMAP_WIDTH*BITMAP_HEIGHT*3; i++)
bitmap[i] = 0;
double max = 0;
y = parts[i].y / l->height * BITMAP_HEIGHT;
y = BITMAP_HEIGHT - 1 - y;
if (x>=0 && x<BITMAP_WIDTH && y>=0 && y<BITMAP_HEIGHT) {
- #if 0
- color = log(1+mcl->weight[i])/log(1+max);
- /* color = 0.3+0*mcl->weight[i]/max; */
- color = fmax(color, 0.2);
- #endif
+ if (changed && nonzero) {
+ color = log(1+mcl->weight[i])/log(1+max);
+ /* color = 0.3+0*mcl->weight[i]/max; */
+ color = fmax(color, 0.2);
+ }
uint8_t rgb[3];
float hsv[3] = {fmod(parts[i].angle, 2*M_PI)/2/M_PI, 1, color};
hsv2rgb(rgb, hsv);