From 8b2cb3059e4267bf320dfe93f7fd355a67bb6f0b Mon Sep 17 00:00:00 2001 From: Eisoku Kuroiwa Date: Tue, 13 Jan 2026 12:39:38 +0900 Subject: [PATCH] add referenceuri to PickPlaceHistoryItem --- include/mujincontrollerclient/mujindefinitions.h | 1 + src/mujindefinitions.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/mujincontrollerclient/mujindefinitions.h b/include/mujincontrollerclient/mujindefinitions.h index d5072d27..55f7ccb1 100644 --- a/include/mujincontrollerclient/mujindefinitions.h +++ b/include/mujincontrollerclient/mujindefinitions.h @@ -135,6 +135,7 @@ class MUJINCLIENT_API PickPlaceHistoryItem : public mujinjson::JsonSerializable std::string containerName; ///< the name of the container where picking occurred for "picked", where placing occurred when "placed", and where touching occurred for "touched" unsigned long long eventTimeStampUS = 0; ///< time that the event ocurred in us (from Linux epoch). For "picked" this is the chuck time, for "placed this is the unchuck time, for "touched" this is the time when the robot supposedly stopped touching/disturbing the object. std::string object_uri; ///< the object uri + std::string referenceuri; ///< the object uri Transform objectpose; ///< 7-values in world, unit is usually mm AABB localaabb; ///< AABB of object in object frame. unsigned long long sensorTimeStampUS = 0; ///< sensor timestamp in us (from Linux epoch) of when the object was detected in the scene diff --git a/src/mujindefinitions.cpp b/src/mujindefinitions.cpp index 374322c3..e22c9b38 100644 --- a/src/mujindefinitions.cpp +++ b/src/mujindefinitions.cpp @@ -25,6 +25,7 @@ void PickPlaceHistoryItem::Reset() containerName.clear(); eventTimeStampUS = 0; object_uri.clear(); + referenceuri.clear(); objectpose = Transform(); localaabb = AABB(); sensorTimeStampUS = 0; @@ -54,6 +55,7 @@ void PickPlaceHistoryItem::LoadFromJson(const rapidjson::Value& rItem) mujinjson::LoadJsonValueByKey(rItem, "containerName", containerName); mujinjson::LoadJsonValueByKey(rItem, "eventTimeStampUS", eventTimeStampUS); mujinjson::LoadJsonValueByKey(rItem, "object_uri", object_uri); + mujinjson::LoadJsonValueByKey(rItem, "referenceuri", referenceuri); const rapidjson::Value::ConstMemberIterator itPose = rItem.FindMember("objectpose"); if( itPose != rItem.MemberEnd() ) { @@ -86,6 +88,7 @@ void PickPlaceHistoryItem::SaveToJson(rapidjson::Value& rItem, rapidjson::Docume mujinjson::SetJsonValueByKey(rItem, "containerName", containerName, alloc); mujinjson::SetJsonValueByKey(rItem, "eventTimeStampUS", eventTimeStampUS, alloc); mujinjson::SetJsonValueByKey(rItem, "object_uri", object_uri, alloc); + mujinjson::SetJsonValueByKey(rItem, "referenceuri", referenceuri, alloc); std::array posearray; posearray[0] = objectpose.quaternion[0]; posearray[1] = objectpose.quaternion[1];