-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gfx-replay and JSON serialization fixes (#1758)
* gfx-replay scaling fix (relevant for URDF scaling) * add file-write error-checking to Recorder::writeSavedKeyframesToFile * force compile errors for missing JSON serialization functions * fix JSON serialize compile issues * add python binding for gfx-replay writeSavedKeyframesToString * add JSON serialization for std::pair * update comment * formatting fix
- Loading branch information
1 parent
d57275e
commit 0c33790
Showing
9 changed files
with
146 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Facebook, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#include "JsonAllTypes.h" | ||
|
||
namespace esp { | ||
namespace io { | ||
|
||
JsonGenericValue toJsonValue(const std::string& str, JsonAllocator& allocator) { | ||
JsonGenericValue strObj; | ||
strObj.SetString(str.c_str(), allocator); | ||
return strObj; | ||
} | ||
|
||
bool fromJsonValue(const JsonGenericValue& obj, std::string& val) { | ||
if (obj.IsString()) { | ||
val = obj.GetString(); | ||
return true; | ||
} | ||
ESP_ERROR() << "Invalid string value"; | ||
return false; | ||
} | ||
|
||
} // namespace io | ||
} // namespace esp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters