Skip to content

Commit

Permalink
Remove inappropriate executable bits and minor reformat of code and c…
Browse files Browse the repository at this point in the history
…hangelog.

PiperOrigin-RevId: 416854656
Change-Id: I554d2c5667282567a129d79d91d8f2e97146d6f5
  • Loading branch information
saran-t committed Dec 16, 2021
1 parent a499b38 commit ee39340
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 50 deletions.
4 changes: 2 additions & 2 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^
Expand All @@ -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 <sensor-force>` and :ref:`torque <sensor-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 <equality-connect>` and
:ref:`weld <equality-weld>` constraints.

Expand Down
60 changes: 30 additions & 30 deletions include/mujoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Empty file modified model/composite/asset/carpet.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified model/composite/asset/marble.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified model/composite/asset/sponge.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified model/composite/cloth.xml
100755 → 100644
Empty file.
Empty file modified model/composite/grid2pin.xml
100755 → 100644
Empty file.
Empty file modified model/composite/loop.xml
100755 → 100644
Empty file.
Empty file modified model/composite/particle.xml
100755 → 100644
Empty file.
Empty file modified model/composite/rope.xml
100755 → 100644
Empty file.
Empty file modified model/composite/scene.xml
100755 → 100644
Empty file.
Empty file modified model/composite/softbox.xml
100755 → 100644
Empty file.
Empty file modified model/hammock/humanoid_body.xml
100755 → 100644
Empty file.
Empty file modified model/humanoid/humanoid.xml
100755 → 100644
Empty file.
Empty file modified model/humanoid100/humanoid100.xml
100755 → 100644
Empty file.
Empty file modified model/humanoid100/humanoid_body.xml
100755 → 100644
Empty file.
Empty file modified model/tendon_arm/arm26.xml
100755 → 100644
Empty file.
8 changes: 3 additions & 5 deletions sample/derivative.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
#if defined(_OPENMP)
#include <omp.h>
#else
// omp timer replacement
// omp timer replacement
#include <chrono>
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<double> elapsed = std::chrono::system_clock::now() - _start;
return elapsed.count();
Expand All @@ -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
Expand Down
24 changes: 11 additions & 13 deletions sample/simulate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,26 +635,24 @@ 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.index<m->NR*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.index<m->NR*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
}



//-------------------------------- UI construction --------------------------------------
//---------------------------------- UI construction -----------------------------------------------

// make physics section of UI
void makephysics(int oldstate) {
Expand Down
Empty file modified sample/testspeed.cc
100755 → 100644
Empty file.
Empty file modified sample/testxml.cc
100755 → 100644
Empty file.

0 comments on commit ee39340

Please sign in to comment.