Skip to content

Commit

Permalink
commited a lot of unstaged stuff, no idea what they do...
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervDooren committed Aug 14, 2023
1 parent 495ffac commit ff8f81a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions include/ed/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ class Entity
has_pose_ = true;
}

inline void setPoseFrame(const std::string& frame_name)
{
pose_frame_ = frame_name;
}

inline const std::string poseFrame() const
{
return pose_frame_;
}

inline bool has_pose() const { return has_pose_; }

inline const tue::config::DataConstPointer& data() const { return config_; }
Expand Down Expand Up @@ -256,6 +266,7 @@ class Entity

bool has_pose_;
geo::Pose3D pose_;
std::string pose_frame_;

// double creation_time_;

Expand Down
1 change: 1 addition & 0 deletions include/ed/helpers/msg_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void convert(const ed::Entity& e, ed_msgs::EntityInfo& msg) {
{
geo::convert(e.pose(), msg.pose);
}
msg.pose_frame = e.poseFrame();

msg.last_update_time = ros::Time(e.lastUpdateTimestamp());

Expand Down
2 changes: 2 additions & 0 deletions include/ed/update_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ class UpdateRequest
// POSES

std::map<UUID, geo::Pose3D> poses;
std::map<UUID, std::string> pose_frames;
void setPose(const UUID& id, const geo::Pose3D& pose) { poses[id] = pose; flagUpdated(id); }
void setPoseFrame(const UUID& id, const std::string& frame) { pose_frames[id] = frame; flagUpdated(id); }


// RELATIONS
Expand Down
3 changes: 2 additions & 1 deletion src/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Entity::Entity(const UUID& id, const TYPE& type, const unsigned int& measurement
shape_revision_(0),
// creation_time_(creation_time),
has_pose_(false),
pose_(geo::Pose3D::identity())
pose_(geo::Pose3D::identity()),
pose_frame_("map")
{
}

Expand Down
6 changes: 6 additions & 0 deletions src/world_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ void WorldModel::update(const UpdateRequest& req)
EntityPtr e = getOrAddEntity(it->first, new_entities);
e->setPose(it->second);
}
// Update poses
for(std::map<UUID, std::string>::const_iterator it = req.pose_frames.begin(); it != req.pose_frames.end(); ++it)
{
EntityPtr e = getOrAddEntity(it->first, new_entities);
e->setPoseFrame(it->second);
}

// Update shapes
for(std::map<UUID, geo::ShapeConstPtr>::const_iterator it = req.shapes.begin(); it != req.shapes.end(); ++it)
Expand Down

0 comments on commit ff8f81a

Please sign in to comment.