Changeset 21057
- Timestamp:
- 02/29/08 15:43:01 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/gadgeteer/drivers/Ascension/MotionStar/MotionStarStandalone.cpp
r20974 r21057 1216 1216 mNumSensors = 0; 1217 1217 mAddrToSensorIdMap.clear(); 1218 mAddrToSensorIdMap.resize(flock_number, -1);1219 1218 1220 1219 for ( std::vector<FBB::Device*>::iterator b = m_birds.begin(); … … 1274 1273 cur_dev->addr = i + 1; 1275 1274 1275 // If the device has a sensor, map its FBB address to a 1276 // zero-based, sequential value. 1276 1277 if ( cur_dev->has_sensor ) 1277 1278 { juggler/trunk/modules/gadgeteer/drivers/Ascension/MotionStar/MotionStarStandalone.h
r20974 r21057 34 34 35 35 #include <vpr/vpr.h> 36 37 // VPR_HAVE_HASH_MAP will be defined to 1 or 0 by vpr/vprConfig.h which is 38 // included by vpr/vpr.h. 39 #if VPR_HAVE_HASH_MAP 40 # include VPR_HASH_MAP_INCLUDE 41 #else 42 # include <map> 43 #endif 44 36 45 #include <vpr/IO/Socket/InetAddr.h> 37 46 #include <vpr/IO/Socket/Socket.h> … … 1531 1540 std::vector<FBB::Device*> m_birds; /**< Vector of all devices (birds) 1532 1541 connected to the server chassis */ 1533 std::vector<int> mAddrToSensorIdMap; 1542 1543 /** 1544 * Define the type for \c mAddrToSensorIdMap. We use an actual map here 1545 * rather than, say, a vector because the range of FBB addresses is not 1546 * necessarily [0,n] for n birds. Indeed, a case has been encountered where 1547 * four birds have addresses 2, 3, 4, and 5. In that case, the size of the 1548 * container would be 5 (the extra is to account for the ERT), but we would 1549 * be trying to access (zero-based) index 5 as the largest rahter than 1550 * index 4. 1551 */ 1552 #if VPR_HAVE_HASH_MAP 1553 # if defined(_MSC_VER) 1554 typedef stdext::hash_map<int, int> addr_sensor_map_t; 1555 # else 1556 typedef std::hash_map<int, int> addr_sensor_map_t; 1557 # endif 1558 #else 1559 typedef std::map<int, int> addr_sensor_map_t; 1560 #endif 1561 1562 /** 1563 * Mapping of FBB address (which can be anything greater than or equal to 1564 * zero) to a zero-based, sequential range of integer identifiers. 1565 */ 1566 addr_sensor_map_t mAddrToSensorIdMap; 1534 1567 std::vector<gmtl::Matrix44f> mSampleData; 1535 1568
