Skip to content

Commit

Permalink
fix a return bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yun-long committed Feb 7, 2021
1 parent 4879377 commit 3d6a1a7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions flightlib/src/bridges/unity_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ bool UnityBridge::getRender(const FrameID frame_id) {
pub_msg_.vehicles[idx].rotation = quaternionRos2Unity(quad_state.q());
}

// for (size_t idx = 0; idx < pub_msg_.objects.size(); idx++) {
// std::shared_ptr<DynamicGate<T>> gate = unity_dynamic_gate_[object_i.ID];
// pub_msg_.objects[idx].position = positionROS2Unity(gate->getPos());
// pub_msg_.objects[idx].rotation = rotationROS2Unity(gate->getQuat());
// }
for (size_t idx = 0; idx < pub_msg_.objects.size(); idx++) {
std::shared_ptr<StaticObject> gate = static_objects_[idx];
pub_msg_.objects[idx].position = positionRos2Unity(gate->getPos());
pub_msg_.objects[idx].rotation = quaternionRos2Unity(gate->getQuat());
}

// create new message object
zmqpp::message msg;
Expand Down Expand Up @@ -194,6 +194,7 @@ bool UnityBridge::addStaticObject(std::shared_ptr<StaticObject> static_object) {
static_objects_.push_back(static_object);
settings_.objects.push_back(object_t);
pub_msg_.objects.push_back(object_t);
return true;
}

bool UnityBridge::handleOutput() {
Expand Down

0 comments on commit 3d6a1a7

Please sign in to comment.