Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/production' into fix_checkfn_202…
Browse files Browse the repository at this point in the history
…50129
  • Loading branch information
Puttichai committed Feb 27, 2025
2 parents 6fb8e29 + c09d0d1 commit 5e98823
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/bindings/openravepy_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ void toRapidJSONValue(const object &obj, rapidjson::Value &value, rapidjson::Doc
#if PY_MAJOR_VERSION >= 3
else if (PyUnicode_Check(obj.ptr()))
{
value.SetString(PyUnicode_AsUTF8(obj.ptr()), PyUnicode_GET_LENGTH(obj.ptr()), allocator);
ssize_t size;
const char *utf8 = PyUnicode_AsUTF8AndSize(obj.ptr(), &size);
value.SetString(utf8, size, allocator);
}
#else
else if (PyString_Check(obj.ptr()))
Expand Down
2 changes: 2 additions & 0 deletions test/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ def test_custombody(self):
link1._mapFloatParameters = {'param0':[1,2.3]}
link1._mapIntParameters = {'param0':[4,5,6]}
link1._t[0,3] = 0.5
link1.DeserializeJSON({'stringParameters': [{'id': 'jp3', 'value': u'日本語'}]})

joint0 = KinBody.JointInfo()
joint0._name = 'j0'
Expand All @@ -1113,6 +1114,7 @@ def test_custombody(self):
assert(transdist(body.GetLinks()[1].GetTransform(), array([[ 0.69670671, -0.71735609, 0. , 0.34835335], [ 0.71735609, 0.69670671, 0. , 0.35867805], [ 0. , 0. , 1. , 0. ], [ 0. , 0. , 0. , 1. ]])) <= 1e-7)
assert(body.GetLinks()[0].GetStringParameters('jp') == u'\u65e5\u672c\u8a9e')
assert(body.GetJoints()[0].GetStringParameters('test2') == 'has spaces')
assert(body.GetLinks()[1].GetStringParameters('jp3') == u'\u65e5\u672c\u8a9e') # https://github.com/rdiankov/openrave/pull/1491

def test_paddinggeometry(self):
env=self.env
Expand Down

0 comments on commit 5e98823

Please sign in to comment.