Revision 96c90dc4
fix multiple emitter signal pickup bug
scout/scoutsim/src/sim_frame.cpp | ||
---|---|---|
719 | 719 |
M_Emitter::iterator m_end = emitters.end(); |
720 | 720 |
|
721 | 721 |
//iterate over Emitters: |
722 |
bool updated = false; |
|
722 | 723 |
for (; m_it != m_end; ++m_it) |
723 | 724 |
{ |
724 | 725 |
geometry_msgs::Pose2D emitter_pos; |
... | ... | |
786 | 787 |
it->second->update_BOM(i, 1, emitter_id); |
787 | 788 |
} |
788 | 789 |
else { |
789 |
it->second->update_BOM(i, 0, 0); |
|
790 |
if (!updated) { |
|
791 |
it->second->update_BOM(i, 0, 0); |
|
792 |
} |
|
790 | 793 |
} |
791 | 794 |
} |
792 | 795 |
} else { |
793 | 796 |
// nothing in the emitter range, set everything to 0 |
794 |
for (int i = 0; i<10; i++) { |
|
795 |
it->second->update_BOM(i, 0, 0); |
|
797 |
if (!updated) { |
|
798 |
for (int i = 0; i<10; i++) { |
|
799 |
it->second->update_BOM(i, 0, 0); |
|
800 |
} |
|
796 | 801 |
} |
797 | 802 |
} |
803 |
updated = true; |
|
798 | 804 |
} |
799 | 805 |
|
800 | 806 |
} |
Also available in: Unified diff