From ee39340ae783f6944f74168d852d7ac1664268c0 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Thu, 16 Dec 2021 20:56:15 +0000 Subject: [PATCH] Remove inappropriate executable bits and minor reformat of code and changelog. PiperOrigin-RevId: 416854656 Change-Id: I554d2c5667282567a129d79d91d8f2e97146d6f5 --- doc/changelog.rst | 4 +- include/mujoco.h | 60 ++++++++++++++-------------- model/composite/asset/carpet.png | Bin model/composite/asset/marble.png | Bin model/composite/asset/sponge.png | Bin model/composite/cloth.xml | 0 model/composite/grid2pin.xml | 0 model/composite/loop.xml | 0 model/composite/particle.xml | 0 model/composite/rope.xml | 0 model/composite/scene.xml | 0 model/composite/softbox.xml | 0 model/hammock/humanoid_body.xml | 0 model/humanoid/humanoid.xml | 0 model/humanoid100/humanoid100.xml | 0 model/humanoid100/humanoid_body.xml | 0 model/tendon_arm/arm26.xml | 0 sample/derivative.cc | 8 ++-- sample/simulate.cc | 24 +++++------ sample/testspeed.cc | 0 sample/testxml.cc | 0 21 files changed, 46 insertions(+), 50 deletions(-) mode change 100755 => 100644 model/composite/asset/carpet.png mode change 100755 => 100644 model/composite/asset/marble.png mode change 100755 => 100644 model/composite/asset/sponge.png mode change 100755 => 100644 model/composite/cloth.xml mode change 100755 => 100644 model/composite/grid2pin.xml mode change 100755 => 100644 model/composite/loop.xml mode change 100755 => 100644 model/composite/particle.xml mode change 100755 => 100644 model/composite/rope.xml mode change 100755 => 100644 model/composite/scene.xml mode change 100755 => 100644 model/composite/softbox.xml mode change 100755 => 100644 model/hammock/humanoid_body.xml mode change 100755 => 100644 model/humanoid/humanoid.xml mode change 100755 => 100644 model/humanoid100/humanoid100.xml mode change 100755 => 100644 model/humanoid100/humanoid_body.xml mode change 100755 => 100644 model/tendon_arm/arm26.xml mode change 100755 => 100644 sample/testspeed.cc mode change 100755 => 100644 sample/testxml.cc diff --git a/doc/changelog.rst b/doc/changelog.rst index 3b053b75..3879c20e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -24,7 +24,7 @@ General 4. Safer string handling: replaced ``strcat``, ``strcpy``, and ``sprintf`` with ``strncat``, ``strncpy``, and ``snprintf`` respectively. -#. Changed indentation from 4 spaces to 2 spaces everywhere. +#. Changed indentation from 4 spaces to 2 spaces, K&R bracing style, added braces to one-line conditionals. Bug Fixes ^^^^^^^^^ @@ -40,7 +40,7 @@ Bug Fixes This is a minor breaking change. Simulation of a model with automatically-computed capsule inertias will be numerically different, leading to, for example, breakage of golden-value tests. #. Fixed bug related to :ref:`force ` and :ref:`torque ` sensors. Until this change, forces - torques reported by F/T sensors ignored out-of-tree constraint wrenches except those produced by contacts. Force and + and torques reported by F/T sensors ignored out-of-tree constraint wrenches except those produced by contacts. Force and torque sensors now correctly take into account the effects of :ref:`connect ` and :ref:`weld ` constraints. diff --git a/include/mujoco.h b/include/mujoco.h index 89cd5855..c62ea466 100644 --- a/include/mujoco.h +++ b/include/mujoco.h @@ -765,38 +765,38 @@ MJAPI void mju_writeLog(const char* type, const char* msg); #define mjMIN(a,b) (((a) < (b)) ? (a) : (b)) #ifdef mjUSEDOUBLE -#define mju_sqrt sqrt -#define mju_exp exp -#define mju_sin sin -#define mju_cos cos -#define mju_tan tan -#define mju_asin asin -#define mju_acos acos -#define mju_atan2 atan2 -#define mju_tanh tanh -#define mju_pow pow -#define mju_abs fabs -#define mju_log log -#define mju_log10 log10 -#define mju_floor floor -#define mju_ceil ceil + #define mju_sqrt sqrt + #define mju_exp exp + #define mju_sin sin + #define mju_cos cos + #define mju_tan tan + #define mju_asin asin + #define mju_acos acos + #define mju_atan2 atan2 + #define mju_tanh tanh + #define mju_pow pow + #define mju_abs fabs + #define mju_log log + #define mju_log10 log10 + #define mju_floor floor + #define mju_ceil ceil #else -#define mju_sqrt sqrtf -#define mju_exp expf -#define mju_sin sinf -#define mju_cos cosf -#define mju_tan tanf -#define mju_asin asinf -#define mju_acos acosf -#define mju_atan2 atan2f -#define mju_tanh tanhf -#define mju_pow powf -#define mju_abs fabsf -#define mju_log logf -#define mju_log10 log10f -#define mju_floor floorf -#define mju_ceil ceilf + #define mju_sqrt sqrtf + #define mju_exp expf + #define mju_sin sinf + #define mju_cos cosf + #define mju_tan tanf + #define mju_asin asinf + #define mju_acos acosf + #define mju_atan2 atan2f + #define mju_tanh tanhf + #define mju_pow powf + #define mju_abs fabsf + #define mju_log logf + #define mju_log10 log10f + #define mju_floor floorf + #define mju_ceil ceilf #endif diff --git a/model/composite/asset/carpet.png b/model/composite/asset/carpet.png old mode 100755 new mode 100644 diff --git a/model/composite/asset/marble.png b/model/composite/asset/marble.png old mode 100755 new mode 100644 diff --git a/model/composite/asset/sponge.png b/model/composite/asset/sponge.png old mode 100755 new mode 100644 diff --git a/model/composite/cloth.xml b/model/composite/cloth.xml old mode 100755 new mode 100644 diff --git a/model/composite/grid2pin.xml b/model/composite/grid2pin.xml old mode 100755 new mode 100644 diff --git a/model/composite/loop.xml b/model/composite/loop.xml old mode 100755 new mode 100644 diff --git a/model/composite/particle.xml b/model/composite/particle.xml old mode 100755 new mode 100644 diff --git a/model/composite/rope.xml b/model/composite/rope.xml old mode 100755 new mode 100644 diff --git a/model/composite/scene.xml b/model/composite/scene.xml old mode 100755 new mode 100644 diff --git a/model/composite/softbox.xml b/model/composite/softbox.xml old mode 100755 new mode 100644 diff --git a/model/hammock/humanoid_body.xml b/model/hammock/humanoid_body.xml old mode 100755 new mode 100644 diff --git a/model/humanoid/humanoid.xml b/model/humanoid/humanoid.xml old mode 100755 new mode 100644 diff --git a/model/humanoid100/humanoid100.xml b/model/humanoid100/humanoid100.xml old mode 100755 new mode 100644 diff --git a/model/humanoid100/humanoid_body.xml b/model/humanoid100/humanoid_body.xml old mode 100755 new mode 100644 diff --git a/model/tendon_arm/arm26.xml b/model/tendon_arm/arm26.xml old mode 100755 new mode 100644 diff --git a/sample/derivative.cc b/sample/derivative.cc index f8810838..264a2e28 100644 --- a/sample/derivative.cc +++ b/sample/derivative.cc @@ -22,10 +22,9 @@ #if defined(_OPENMP) #include #else -// omp timer replacement + // omp timer replacement #include - double omp_get_wtime(void) - { + double omp_get_wtime(void) { static std::chrono::system_clock::time_point _start = std::chrono::system_clock::now(); std::chrono::duration elapsed = std::chrono::system_clock::now() - _start; return elapsed.count(); @@ -34,8 +33,7 @@ // omp functions used below void omp_set_dynamic(int) {} void omp_set_num_threads(int) {} - int omp_get_num_procs(void) - { + int omp_get_num_procs(void) { return 1; } #endif diff --git a/sample/simulate.cc b/sample/simulate.cc index e0471b36..b3323825 100644 --- a/sample/simulate.cc +++ b/sample/simulate.cc @@ -635,18 +635,16 @@ void watch(void) { MJDATA_POINTERS_PREAMBLE(m); // find specified field in mjData arrays, update value - #define X(TYPE, NAME, NR, NC) \ - if( !mju::strcmp_arr(#NAME, settings.field) && \ - !mju::strcmp_arr(#TYPE, "mjtNum") ) \ - { \ - if( settings.index>=0 && settings.indexNR*NC ) \ - printfield(ui0.sect[SECT_WATCH].item[2].multi.name[0], \ - d->NAME + settings.index); \ - else \ - mju::strcpy_arr(ui0.sect[SECT_WATCH].item[2].multi.name[0], \ - "invalid index"); \ - return; \ - } + #define X(TYPE, NAME, NR, NC) \ + if (!mju::strcmp_arr(#NAME, settings.field) && \ + !mju::strcmp_arr(#TYPE, "mjtNum")) { \ + if (settings.index>=0 && settings.indexNR*NC) { \ + printfield(ui0.sect[SECT_WATCH].item[2].multi.name[0], d->NAME + settings.index); \ + } else { \ + mju::strcpy_arr(ui0.sect[SECT_WATCH].item[2].multi.name[0], "invalid index"); \ + } \ + return; \ + } MJDATA_POINTERS #undef X @@ -654,7 +652,7 @@ void watch(void) { -//-------------------------------- UI construction -------------------------------------- +//---------------------------------- UI construction ----------------------------------------------- // make physics section of UI void makephysics(int oldstate) { diff --git a/sample/testspeed.cc b/sample/testspeed.cc old mode 100755 new mode 100644 diff --git a/sample/testxml.cc b/sample/testxml.cc old mode 100755 new mode 100644