diff --git a/common/data_broker/src/DataBroker.cpp b/common/data_broker/src/DataBroker.cpp index 5f571a360..61bbd1f9e 100644 --- a/common/data_broker/src/DataBroker.cpp +++ b/common/data_broker/src/DataBroker.cpp @@ -234,7 +234,7 @@ namespace mars { elementsLock.lockForRead(); elementIt = elementsByName.find(std::make_pair(pendingIt->groupName, pendingIt->dataName)); - if(elementIt == elementsByName.end()) { + if(elementIt != elementsByName.end()) { DataElement *element = elementIt->second; TimedReceiver timedReceiver = {pendingIt->receiver, element, pendingIt->updatePeriod, @@ -510,7 +510,8 @@ namespace mars { pendingRegistrationLock.lock(); for(pendingIt = pendingTimedRegistrations.begin(); pendingIt != pendingTimedRegistrations.end(); /* do nothing */) { - if((pendingIt->timerName == timerName) && + if((pendingIt->receiver == receiver) && + (pendingIt->timerName == timerName) && matchPattern(groupName, pendingIt->groupName) && matchPattern(dataName, pendingIt->dataName)) { pendingIt = pendingTimedRegistrations.erase(pendingIt); diff --git a/common/graphics/osg_terrain/CMakeLists.txt b/common/graphics/osg_terrain/CMakeLists.txt index 2f9b0c13a..8bb836db5 100644 --- a/common/graphics/osg_terrain/CMakeLists.txt +++ b/common/graphics/osg_terrain/CMakeLists.txt @@ -11,6 +11,16 @@ find_package(OpenSceneGraph REQUIRED osgDB osgText osgUtil) include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) link_directories(${OPENSCENEGRAPH_LIBRARY_DIRS}) +if(WIN32) + # this fixes the error 998 from the LibManager + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-auto-import") + set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-auto-import") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +else(WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif(WIN32) + set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENSCENEGRAPH_INCLUDE_DIRS}) CHECK_INCLUDE_FILE_CXX("osg/Version" HAVE_OSG_VERSION_H) if(${HAVE_OSG_VERSION_H}) diff --git a/sim/src/sensors/CameraSensor.cpp b/sim/src/sensors/CameraSensor.cpp index b7d7cccca..06e485787 100644 --- a/sim/src/sensors/CameraSensor.cpp +++ b/sim/src/sensors/CameraSensor.cpp @@ -68,7 +68,7 @@ namespace mars { control->nodes->addNodeSensor(this); std::string groupName, dataName; - this->config.ori_offset = this->config.ori_offset * eulerToQuaternion(Vector(90,0,-90)); //All elements should be X Forwart looging to meet rock-convention, so i add this offset for all setting + //this->config.ori_offset = this->config.ori_offset * eulerToQuaternion(Vector(90,0,-90)); //All elements should be X Forwart looging to meet rock-convention, so i add this offset for all setting bool found = control->nodes->getDataBrokerNames(attached_node, &groupName, &dataName); assert(found); @@ -330,7 +330,8 @@ namespace mars { // todo: use pos_offset here too Vector p = control->graphics->getDrawObjectPosition(draw_id); Quaternion qcorrect = Quaternion(0.5, 0.5, -0.5, -0.5); - Quaternion q = control->graphics->getDrawObjectQuaternion(draw_id) * qcorrect; + Quaternion q = control->graphics->getDrawObjectQuaternion(draw_id) * config.ori_offset * qcorrect; + p += (control->graphics->getDrawObjectQuaternion(draw_id) * config.pos_offset); gc->updateViewportQuat(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), q.w());