From bf3ee4620ec012b8f9f69afe7e33543ad451c444 Mon Sep 17 00:00:00 2001 From: Eisoku Kuroiwa Date: Tue, 14 Apr 2026 14:51:36 +0900 Subject: [PATCH] support containerId in pick history (cherry picked from commit 2d9c205ec22edc5e4ec392332739f5e7c52500df) --- 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 55f7ccb1..02e7bc54 100644 --- a/include/mujincontrollerclient/mujindefinitions.h +++ b/include/mujincontrollerclient/mujindefinitions.h @@ -133,6 +133,7 @@ class MUJINCLIENT_API PickPlaceHistoryItem : public mujinjson::JsonSerializable std::string pickPlaceType; ///< the type of action that ocurred can be: "picked", "placed", "touched" std::string locationName; ///< the name of the location where picking occurred for "picked", where placing occurred when "placed", and where touching occurred for "touched" std::string containerName; ///< the name of the container where picking occurred for "picked", where placing occurred when "placed", and where touching occurred for "touched" + std::string containerId; ///< the id 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 diff --git a/src/mujindefinitions.cpp b/src/mujindefinitions.cpp index e22c9b38..a8fef3fb 100644 --- a/src/mujindefinitions.cpp +++ b/src/mujindefinitions.cpp @@ -23,6 +23,7 @@ void PickPlaceHistoryItem::Reset() pickPlaceType.clear(); locationName.clear(); containerName.clear(); + containerId.clear(); eventTimeStampUS = 0; object_uri.clear(); referenceuri.clear(); @@ -53,6 +54,7 @@ void PickPlaceHistoryItem::LoadFromJson(const rapidjson::Value& rItem) mujinjson::LoadJsonValueByKey(rItem, "pickPlaceType", pickPlaceType); mujinjson::LoadJsonValueByKey(rItem, "locationName", locationName); mujinjson::LoadJsonValueByKey(rItem, "containerName", containerName); + mujinjson::LoadJsonValueByKey(rItem, "containerId", containerId); mujinjson::LoadJsonValueByKey(rItem, "eventTimeStampUS", eventTimeStampUS); mujinjson::LoadJsonValueByKey(rItem, "object_uri", object_uri); mujinjson::LoadJsonValueByKey(rItem, "referenceuri", referenceuri); @@ -86,6 +88,7 @@ void PickPlaceHistoryItem::SaveToJson(rapidjson::Value& rItem, rapidjson::Docume mujinjson::SetJsonValueByKey(rItem, "pickPlaceType", pickPlaceType, alloc); mujinjson::SetJsonValueByKey(rItem, "locationName", locationName, alloc); mujinjson::SetJsonValueByKey(rItem, "containerName", containerName, alloc); + mujinjson::SetJsonValueByKey(rItem, "containerId", containerId, alloc); mujinjson::SetJsonValueByKey(rItem, "eventTimeStampUS", eventTimeStampUS, alloc); mujinjson::SetJsonValueByKey(rItem, "object_uri", object_uri, alloc); mujinjson::SetJsonValueByKey(rItem, "referenceuri", referenceuri, alloc);