Skip to content

Commit 518e7c5

Browse files
author
Taiju Yamada
committed
Merge remote-tracking branch 'origin/master' into githubaction
2 parents 9e986d7 + 2aff381 commit 518e7c5

29 files changed

Lines changed: 1426 additions & 474 deletions

CHANELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,89 @@
11
# Changelog
22

3+
## 0.82.2 (2025-10-08)
4+
5+
- Add support for std::optional
6+
7+
## 0.82.1 (2025-07-23)
8+
9+
- Fix template resolution for nested container types in mujinjson
10+
11+
## 0.82.0 (2025-06-27)
12+
13+
- Add targetTemplateSceneData in RegisterMinViableRegionInfo.
14+
15+
## 0.81.1 (2025-04-14)
16+
17+
- Use only ZMQ for BinPickingTask when compiled with ZMQ.
18+
19+
## 0.81.0 (2025-03-31)
20+
21+
- Rename octagonalCaseClassificationInfo to registrationVisionInfo to hold general vision related info.
22+
23+
## 0.80.0 (2025-03-28)
24+
25+
- Add support for GraphQL subscriptions.
26+
27+
## 0.79.0 (2025-02-04)
28+
29+
- Support octagonalCaseClassificationInfo in RegisterMinViableRegionInfo.
30+
31+
## 0.78.1 (2025-01-16)
32+
33+
add pointCloudWaitForTrigger into ExecutionVerificationMode enum.
34+
35+
## 0.78.0 (2024-12-03)
36+
37+
add option to resolve IP from host if unique in GetURL().
38+
39+
## 0.77.0 (2024-11-14)
40+
41+
fix mujinjson.h SaveJsonValue specializing stacked array values to bool
42+
43+
## 0.76.1 (2024-11-08)
44+
45+
fix mujinjson.h SaveJsonValue const char* variation.
46+
47+
## 0.76.0 (2024-11-03)
48+
49+
- fix mujinjson.h SaveJsonValue char[] variation.
50+
51+
## 0.75.0 (2024-11-02)
52+
53+
- mujinjson uses rapidjson::GenericValue with templates to allow for other allocators.
54+
55+
## 0.74.2 (2024-10-28)
56+
57+
- Move important code out of the ASSERT blocks in mujinjson
58+
59+
## 0.74.1 (2024-10-25)
60+
61+
- Handle serialization of NaN/Inf values in JSON
62+
63+
## 0.74.0 (2024-09-27)
64+
65+
- Enable non-virtual-dtor error detection and implement missing virtual destructors
66+
67+
## 0.73.4 (2024-08-07)
68+
69+
- Fix the logging error with 'No error', ensured that the curl function is executed only once in the CHECKCURLCODE macro.
70+
71+
## 0.73.3 (2024-07-30)
72+
73+
- Fix missing buffer reset in post helper function.
74+
75+
## 0.73.2 (2024-06-26)
76+
77+
- Fix invalid JSON string construction.
78+
79+
## 0.73.1 (2024-06-12)
80+
81+
- Add post helper function for formdata.
82+
83+
## 0.73.0 (2024-06-08)
84+
85+
- Remove `rotationmat` from `ResultOBB`. Use fixed size array on `ResultOBB`.
86+
387
## 0.72.0 (2024-04-27)
488

589
- change `CreateLogEntries` to use `vector<LogEntry>` for memory optimization

CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
1818
# Define here the needed parameters
1919
# make sure to change the version in docs/Makefile
2020
set (MUJINCLIENT_VERSION_MAJOR 0)
21-
set (MUJINCLIENT_VERSION_MINOR 72)
22-
set (MUJINCLIENT_VERSION_PATCH 0)
21+
set (MUJINCLIENT_VERSION_MINOR 82)
22+
set (MUJINCLIENT_VERSION_PATCH 2)
2323
set (MUJINCLIENT_VERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR}.${MUJINCLIENT_VERSION_PATCH})
2424
set (MUJINCLIENT_SOVERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR})
2525
set (CLIENT_SOVERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR})
@@ -55,6 +55,11 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
5555
# which point to directories outside the build tree to the install RPATH
5656
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
5757

58+
set(COMPILER_IS_CLANG FALSE)
59+
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
60+
set(COMPILER_IS_CLANG TRUE)
61+
endif()
62+
5863
include(CheckIncludeFile)
5964
include(CheckIncludeFileCXX)
6065
include(CheckLibraryExists)
@@ -73,7 +78,7 @@ include_directories(${MUJINCLIENT_INCLUDE_LOCAL_DIRS})
7378
if( MSVC )
7479
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
7580
add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE)
76-
81+
7782
#gives linking problems
7883
#string(REGEX REPLACE "/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
7984
#string(REGEX REPLACE "/MDd" "/MD" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
@@ -105,7 +110,7 @@ if( MSVC )
105110
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/msvc_include/stdint.h DESTINATION include/mujinclient-${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR} COMPONENT ${COMPONENT_PREFIX}dev)
106111
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/msvc_include)
107112
endif()
108-
113+
109114
# have to install dlls manually
110115
if( MSVC70 OR MSVC71 )
111116
set(MSVC_PREFIX "vc70")
@@ -121,7 +126,7 @@ if( MSVC )
121126
set(MSVC_PREFIX2 "v100")
122127
endif()
123128
set(MUJINCLIENT_LIBRARY_SUFFIX "${MUJINCLIENT_SOVERSION}-${MSVC_PREFIX}-mt" CACHE STRING "Suffix to append to library names")
124-
129+
125130
# install all DLLs
126131
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/msvc_binaries/${MUJINCLIENT_TARGET_PROCESSOR}/${MSVC_PREFIX}/bin/" DESTINATION bin FILES_MATCHING PATTERN "*.dll")
127132

@@ -253,7 +258,7 @@ endif()
253258

254259

255260
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
256-
add_definitions("-fno-strict-aliasing -Wall -Werror=shadow")
261+
add_definitions("-fno-strict-aliasing -Wall -Werror=shadow -Werror=non-virtual-dtor")
257262
endif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
258263

259264
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/mujincontrollerclient/config.h IMMEDIATE @ONLY)

include/mujincontrollerclient/binpickingtask.h

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ namespace mujinclient {
2828
/// Margins of the container to be cropped (or enlarged if negative), in order to define 3D container region under (calibration & shape) uncertainty - for pointcloud processing.
2929
struct CropContainerMarginsXYZXYZ
3030
{
31-
double minMargins[3]; ///< XYZ of how much to crop from min margins (value > 0 means crop inside)
32-
double maxMargins[3]; ///< XYZ of how much to crop from min margins (value > 0 means crop inside)
31+
double minMargins[3] = {0, 0, 0}; ///< XYZ of how much to crop from min margins (value > 0 means crop inside)
32+
double maxMargins[3] = {0, 0, 0}; ///< XYZ of how much to crop from min margins (value > 0 means crop inside)
3333
};
3434

3535
typedef boost::shared_ptr<CropContainerMarginsXYZXYZ> CropContainerMarginsXYZXYZPtr;
@@ -56,28 +56,29 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
5656
std::string object_uri; // "object_uri": "mujin:/box0.mujin.dae"
5757
Transform transform; ///< pose of the object in the world coordinate system
5858
std::string confidence;
59-
unsigned long long timestamp; ///< sensor timestamp in ms (from Linux epoch)
59+
unsigned long long timestamp = 0; ///< sensor timestamp in ms (from Linux epoch)
6060
std::string extra; // (OPTIONAL) "extra": {"type":"randombox", "length":100, "width":100, "height":100}
61-
bool isPickable; ///< whether the object is pickable
61+
bool isPickable = false; ///< whether the object is pickable
6262
};
6363

6464
struct MUJINCLIENT_API PointCloudObstacle
6565
{
6666
std::string name;
6767
std::vector<float> points; ///< consecutive x,y,z values in meter
68-
Real pointsize; ///< size of each point in meter
68+
Real pointsize = 0; ///< size of each point in meter
6969
};
7070

7171
struct MUJINCLIENT_API SensorOcclusionCheck
7272
{
7373
std::string bodyname; ///< name of body whose visibility is to be checked
7474
std::string cameraname; ///< name of camera
75-
unsigned long long starttime; ///< milisecond
76-
unsigned long long endtime; ///< milisecond
75+
unsigned long long starttime = 0; ///< milisecond
76+
unsigned long long endtime = 0; ///< milisecond
7777
};
7878

7979
struct MUJINCLIENT_API ResultBase
8080
{
81+
virtual ~ResultBase() {}
8182
virtual void Parse(const rapidjson::Value& pt) = 0;
8283
};
8384
typedef boost::shared_ptr<ResultBase> ResultBasePtr;
@@ -86,8 +87,8 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
8687
{
8788
AddPointOffsetInfo() : zOffsetAtBottom(0), zOffsetAtTop(0) {
8889
}
89-
double zOffsetAtBottom;
90-
double zOffsetAtTop;
90+
double zOffsetAtBottom = 0;
91+
double zOffsetAtTop = 0;
9192
};
9293
typedef boost::shared_ptr<AddPointOffsetInfo> AddPointOffsetInfoPtr;
9394

@@ -106,7 +107,7 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
106107
virtual ~ResultMoveJoints();
107108
void Parse(const rapidjson::Value& pt);
108109
std::string robottype;
109-
int numpoints;
110+
int numpoints = 0;
110111
std::vector<Real> timedjointvalues;
111112
//Real elapsedtime;
112113
};
@@ -122,14 +123,14 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
122123
{
123124
void Parse(const rapidjson::Value& pt);
124125
std::vector<Real> translation;
125-
std::vector<Real> quaternion;
126+
std::vector<Real> quaternion = {1, 0, 0, 0};
126127
std::vector<Real> direction;
127-
Real angleXZ;
128-
Real angleYX;
129-
Real angleZY;
130-
Real angleX;
131-
Real angleY;
132-
Real angleZ;
128+
Real angleXZ = 0;
129+
Real angleYX = 0;
130+
Real angleZY = 0;
131+
Real angleX = 0;
132+
Real angleY = 0;
133+
Real angleZ = 0;
133134
};
134135

135136
struct MUJINCLIENT_API ResultComputeIKFromParameters : public ResultBase
@@ -158,7 +159,7 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
158159
{
159160
mujin::SensorSelectionInfo sensorSelectionInfo;
160161
std::string bodyname;
161-
int isocclusion;
162+
int isocclusion = 0;
162163
};
163164

164165
ResultGetBinpickingState();
@@ -167,24 +168,24 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
167168
std::string statusPickPlace;
168169
std::string statusDescPickPlace;
169170
std::string statusPhysics;
170-
bool isDynamicEnvironmentStateEmpty;
171+
bool isDynamicEnvironmentStateEmpty = true;
171172

172-
int pickAttemptFromSourceId;
173-
unsigned long long timestamp; ///< ms
174-
unsigned long long lastGrabbedTargetTimeStamp; ///< ms
173+
int pickAttemptFromSourceId = 0;
174+
unsigned long long timestamp = 0; ///< ms
175+
unsigned long long lastGrabbedTargetTimeStamp = 0; ///< ms
175176
//bool isRobotOccludingSourceContainer; ///?
176177
std::vector<OcclusionResult> vOcclusionResults;
177178
std::vector<mujin::LocationTrackingInfo> activeLocationTrackingInfos;
178179
std::vector<mujin::LocationExecutionInfo> locationExecutionInfos;
179180

180-
bool isGrabbingTarget;
181-
bool isGrabbingLastTarget;
181+
bool isGrabbingTarget = false;
182+
bool isGrabbingLastTarget = false;
182183

183184
bool hasRobotExecutionStarted=false;
184-
int orderNumber; ///< -1 if not initiaized
185-
int numLeftInOrder; ///< -1 if not initiaized
186-
int numLeftInSupply; ///< -1 if not initiaized
187-
int placedInDest; ///< -1 if not initiaized
185+
int orderNumber = -1; ///< -1 if not initiaized
186+
int numLeftInOrder = -1; ///< -1 if not initiaized
187+
int numLeftInSupply = -1; ///< -1 if not initiaized
188+
int placedInDest = -1; ///< -1 if not initiaized
188189
std::string cycleIndex; ///< index of the published cycle that pickworker is currently executing
189190

190191
/**
@@ -206,32 +207,34 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
206207
struct MinViableRegionInfo
207208
{
208209
MinViableRegionInfo();
209-
std::array<double, 2> size2D; ///< width and length on the MVR
210-
std::array<double, 3> maxPossibleSize; ///< the max possible size of actual item
211-
std::array<double, 3> maxPossibleSizeOriginal; ///< the maxPossibleSize that has originally been given from vision
212-
uint8_t cornerMaskOriginal; ///< the cornerMask that has originally been given from vision
213-
uint8_t cornerMask; ///< Represents the corner(s) used for corner based detection. 4 bit. -x-y = 1, +x-y = 2, -x+y = 4, +x+y = 8
210+
std::array<double, 2> size2D = {0, 0}; ///< width and length on the MVR
211+
std::array<double, 3> maxPossibleSize = {0, 0, 0}; ///< the max possible size of actual item
212+
std::array<double, 3> maxPossibleSizeOriginal = {0, 0, 0}; ///< the maxPossibleSize that has originally been given from vision
213+
uint8_t cornerMaskOriginal = 0; ///< the cornerMask that has originally been given from vision
214+
uint8_t cornerMask = 0; ///< Represents the corner(s) used for corner based detection. 4 bit. -x-y = 1, +x-y = 2, -x+y = 4, +x+y = 8
214215
} minViableRegion;
215216

216217
std::string locationName; ///< The name of the location where the minViableRegion was triggered for
217-
std::array<double, 3> translation; ///< Translation of the 2D MVR plane (height = 0)
218-
std::array<double, 4> quaternion; ///< Rotation of the 2D MVR plane (height = 0)
219-
double objectWeight; ///< If non-zero, use this weight fo registration. unit is kg. zero means unknown.
218+
std::array<double, 3> translation = {0, 0, 0}; ///< Translation of the 2D MVR plane (height = 0)
219+
std::array<double, 4> quaternion = {1, 0, 0, 0}; ///< Rotation of the 2D MVR plane (height = 0)
220+
double objectWeight = 0; ///< If non-zero, use this weight fo registration. unit is kg. zero means unknown.
220221
std::string objectType; ///< The type of the object
221-
uint64_t sensorTimeStampMS; ///< Same as DetectedObject's timestamp sent to planning
222-
double robotDepartStopTimestamp; ///< Force capture after robot stops
223-
std::array<double, 3> liftedWorldOffset; ///< [dx, dy, dz], mm in world frame
224-
std::array<double, 3> maxCandidateSize; ///< the max candidate size expecting
225-
std::array<double, 3> minCandidateSize; ///< the min candidate size expecting
226-
double transferSpeedPostMult; ///< transfer speed multiplication factor
222+
uint64_t sensorTimeStampMS = 0; ///< Same as DetectedObject's timestamp sent to planning
223+
double robotDepartStopTimestamp = 0; ///< Force capture after robot stops
224+
std::array<double, 3> liftedWorldOffset = {0, 0, 0}; ///< [dx, dy, dz], mm in world frame
225+
std::array<double, 3> maxCandidateSize = {0, 0, 0}; ///< the max candidate size expecting
226+
std::array<double, 3> minCandidateSize = {0, 0, 0}; ///< the min candidate size expecting
227+
double transferSpeedPostMult = 0; ///< transfer speed multiplication factor
228+
rapidjson::Document targetTemplateSceneData; ///< targetTemplateSceneData (a openrave scene that is used as a template for the target object)
227229
rapidjson::Document graspModelInfo; ///< Parameters used for grasping model generation for the object
228-
double minCornerVisibleDist; ///< how much distance along with uncertain edge from uncertain corner robot exposes to camera
229-
double minCornerVisibleInsideDist; ///< how much distance inside MVR robot exposes to camera
230-
double maxCornerAngleDeviation; ///< how much angle deviation around uncertain corner is considered to expose to camera
231-
uint8_t occlusionFreeCornerMask; ///< mask of corners that robot exposes to camera. 4 bit. -x-y = 1, +x-y = 2, -x+y = 4, +x+y = 8
230+
rapidjson::Document registrationVisionInfo; ///< Parameters used for registration vision for the object
231+
double minCornerVisibleDist = 0; ///< how much distance along with uncertain edge from uncertain corner robot exposes to camera
232+
double minCornerVisibleInsideDist = 0; ///< how much distance inside MVR robot exposes to camera
233+
double maxCornerAngleDeviation = 0; ///< how much angle deviation around uncertain corner is considered to expose to camera
234+
uint8_t occlusionFreeCornerMask = 0; ///< mask of corners that robot exposes to camera. 4 bit. -x-y = 1, +x-y = 2, -x+y = 4, +x+y = 8
232235
mujin::MinViableRegionRegistrationMode registrationMode; ///< lift, drag or perpendicular drag
233-
bool skipAppendingToObjectSet; ///< if true, skip appending newly created registration data into an active object set
234-
double maxPossibleSizePadding; ///< how much to additionally expose max possible size region to vision
236+
bool skipAppendingToObjectSet = true; ///< if true, skip appending newly created registration data into an active object set
237+
double maxPossibleSizePadding = 0; ///< how much to additionally expose max possible size region to vision
235238
std::vector<double> fullDofValues; ///< robot configuration state on capturing
236239
std::vector<int8_t> connectedBodyActiveStates; ///< robot configuration state on capturing
237240
bool IsEmpty() const {
@@ -251,7 +254,7 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
251254

252255
struct TriggerDetectionCaptureInfo {
253256
TriggerDetectionCaptureInfo();
254-
double timestamp; ///< timestamp this request was sent. If non-zero, then valid.
257+
double timestamp = 0; ///< timestamp this request was sent. If non-zero, then valid.
255258
std::string triggerType; ///< The type of trigger this is. For now can be: "phase1Detection", "phase2Detection"
256259
std::string locationName; ///< The name of the location for this detection trigger.
257260
std::string targetUpdateNamePrefix; ///< if not empty, use this new targetUpdateNamePrefix for the triggering, otherwise do not change the original targetUpdateNamePrefix
@@ -278,26 +281,24 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
278281
struct MUJINCLIENT_API ResultAABB : public ResultBase
279282
{
280283
void Parse(const rapidjson::Value& pt);
281-
std::vector<Real> pos;
282-
std::vector<Real> extents;
284+
std::array<double, 3> pos;
285+
std::array<double, 3> extents;
283286
};
284287

285288
struct MUJINCLIENT_API ResultOBB : public ResultBase
286289
{
287290
void Parse(const rapidjson::Value& pt);
288291
bool operator!=(const ResultOBB& other) const {
289292
return !mujin::FuzzyEquals(translation, other.translation) ||
290-
!mujin::FuzzyEquals(extents, other.extents) ||
291-
!mujin::FuzzyEquals(rotationmat, other.rotationmat) ||
292-
!mujin::FuzzyEquals(quaternion, other.quaternion);
293+
!mujin::FuzzyEquals(quaternion, other.quaternion) ||
294+
!mujin::FuzzyEquals(extents, other.extents);
293295
}
294296
bool operator==(const ResultOBB& other) const {
295297
return !operator!=(other);
296298
}
297-
std::vector<Real> translation;
298-
std::vector<Real> extents;
299-
std::vector<Real> rotationmat; // row major
300-
std::vector<Real> quaternion; // the quaternion
299+
std::array<double, 3> translation;
300+
std::array<double, 4> quaternion = {1, 0, 0, 0};
301+
std::array<double, 3> extents;
301302
};
302303

303304
struct MUJINCLIENT_API ResultInstObjectInfo : public ResultBase
@@ -331,7 +332,7 @@ class MUJINCLIENT_API BinPickingTaskResource : public TaskResource
331332
void Parse(const rapidjson::Value& pt);
332333
std::string status;
333334
ResultGetBinpickingState taskstate;
334-
Real timestamp;
335+
Real timestamp = 0;
335336
std::string msg;
336337
std::string _slaverequestid;
337338
};

0 commit comments

Comments
 (0)