Trim trailing default values in saved xmls.

For attributes which accept variable-length inputs. Currently used for `gainprm, biasprm, friction, solref, solimp` Example:

- Saved before: `biasprm="0 -3 -4 0 0 0 0 0 0 0"`.
- Saved after: `biasprm="0 -3 -4"`.

PiperOrigin-RevId: 607609550
Change-Id: I0501348280663867693175236872e2aabc703601
This commit is contained in:
Yuval Tassa
2024-02-16 01:35:13 -08:00
committed by Copybara-Service
parent 6a346c42e8
commit f9f7827a64
4 changed files with 65 additions and 26 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ class mjXUtil {
// write attribute- any type
template<typename T>
static void WriteAttr(tinyxml2::XMLElement* elem, std::string name, int n, const T* data,
const T* def = 0);
const T* def = 0, bool trim = false);
// write vector<double> attribute, with and without default
static void WriteVector(tinyxml2::XMLElement* elem, std::string name,