diff --git a/include/mujoco/mjplugin.h b/include/mujoco/mjplugin.h index c142d517..0fc31a6c 100644 --- a/include/mujoco/mjplugin.h +++ b/include/mujoco/mjplugin.h @@ -48,7 +48,7 @@ typedef void (*mjfGetResourceDir)(mjResource* resource, const char** dir, int* n // callback for checking if the current resource was modified from the time // specified by the timestamp // returns 0 if the resource's timestamp matches the provided timestamp -// returns > 0 if the the resource is younger than the given timestamp +// returns > 0 if the resource is younger than the given timestamp // returns < 0 if the resource is older than the given timestamp typedef int (*mjfResourceModified)(const mjResource* resource, const char* timestamp); diff --git a/src/engine/engine_callback.c b/src/engine/engine_callback.c index 67249f2a..148f6dc3 100644 --- a/src/engine/engine_callback.c +++ b/src/engine/engine_callback.c @@ -29,7 +29,7 @@ mjfAct mjcb_act_dyn = 0; -// reset callbacks to defauls +// reset callbacks to defaults void mj_resetCallbacks(void) { mjcb_passive = 0; mjcb_control = 0; diff --git a/src/engine/engine_collision_box.c b/src/engine/engine_collision_box.c index 1860ad4d..d4e78f00 100644 --- a/src/engine/engine_collision_box.c +++ b/src/engine/engine_collision_box.c @@ -475,7 +475,7 @@ int mjraw_CapsuleBox(mjContact* con, mjtNum margin, } else if (cltype >= 0 && cltype / 3 == 1) { // we are on box's edge // hacks to find the relative orientation of capsule and edge // there are 2 cases: - // c1= 2^n: edge and capsule are oriented in a T configuaration (no more contacts + // c1= 2^n: edge and capsule are oriented in a T configuration (no more contacts // c1!=2^n: oriented in a cross X configuration c1 = axisdir ^ clcorner; // same trick diff --git a/src/engine/engine_collision_driver.c b/src/engine/engine_collision_driver.c index 36c81652..655d0b48 100644 --- a/src/engine/engine_collision_driver.c +++ b/src/engine/engine_collision_driver.c @@ -1153,7 +1153,7 @@ int mj_broadphase(const mjModel* m, mjData* d, int* bfpair, int maxpair) { // init with pairs involving always-colliding bodies for (int b1=0; b1 < nbody; b1++) { - // cannot colide + // cannot collide if (!canCollide(m, b1)) { continue; } @@ -1163,7 +1163,7 @@ int mj_broadphase(const mjModel* m, mjData* d, int* bfpair, int maxpair) { (m->body_weldid[b1] == 0 && hasPlane(m, b1))) { // add b1:body pairs that are not welded together for (int b2=0; b2 < nbody; b2++) { - // cannot colide + // cannot collide if (!canCollide(m, b2)) { continue; } diff --git a/src/engine/engine_solver.c b/src/engine/engine_solver.c index 29f30a2e..68465374 100644 --- a/src/engine/engine_solver.c +++ b/src/engine/engine_solver.c @@ -1408,7 +1408,7 @@ static void MakeHessian(const mjModel* m, mjData* d, mjCGContext* ctx) { // add nC to Hessian total nonzeros (unavoidable overcounting since H_colind is still unknown) ctx->nH = m->nC + ctx->H_rowadr[nv - 1] + ctx->H_rownnz[nv - 1]; - // shift H row adresses to make room for C + // shift H row addresses to make room for C int shift = 0; for (int r = 0; r < nv - 1; r++) { shift += d->C_rownnz[r]; @@ -1443,7 +1443,7 @@ static void MakeHessian(const mjModel* m, mjData* d, mjCGContext* ctx) { ctx->nL = mju_cholFactorCount(ctx->L_rownnz, HT_rownnz, HT_rowadr, HT_colind, nv, d); mj_freeStack(d); - // compute L row adresses: rowadr = cumsum(rownnz) + // compute L row addresses: rowadr = cumsum(rownnz) ctx->L_rowadr[0] = 0; for (int r=1; r < nv; r++) { ctx->L_rowadr[r] = ctx->L_rowadr[r-1] + ctx->L_rownnz[r-1]; diff --git a/src/engine/engine_util_solve.h b/src/engine/engine_util_solve.h index 91ea13cc..66e59842 100644 --- a/src/engine/engine_util_solve.h +++ b/src/engine/engine_util_solve.h @@ -114,7 +114,7 @@ MJAPI void mju_boxQPmalloc(mjtNum** res, mjtNum** R, int** index, mjtNum** H, mjtNum** g, int n, mjtNum** lower, mjtNum** upper); -// minimize 0.5*x'*H*x + x'*g s.t. lower <= x <=upper, explicit options (see implemetation) +// minimize 0.5*x'*H*x + x'*g s.t. lower <= x <=upper, explicit options (see implementation) MJAPI int mju_boxQPoption(mjtNum* res, mjtNum* R, int* index, const mjtNum* H, const mjtNum* g, int n, const mjtNum* lower, const mjtNum* upper, diff --git a/src/render/render_context.c b/src/render/render_context.c index b0b2a361..6adb4f11 100644 --- a/src/render/render_context.c +++ b/src/render/render_context.c @@ -895,7 +895,7 @@ static void setVertexHaze(float* v, float az, float h, float r) { // truncated cone for haze rendering static void haze(int nSlice, float r, const float* rgba) { - // compute elevation h for transparancy transition point + // compute elevation h for transparency transition point float alpha = atan2f(1, r); float beta = (float)(0.75*mjPI) - alpha; float h = sqrtf(0.5f) * r * sinf(alpha) / sinf(beta); diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index c1146363..6cfa003b 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -228,7 +228,7 @@ static void initOpenGL(const mjrRect* r, const mjrContext* con) { -// get text width up to specificed limit (0: 0, -1: entire string) +// get text width up to specified limit (0: 0, -1: entire string) static int textwidth(const char* text, const mjrContext* con, int limit) { int i = 0, width = 0; @@ -1523,7 +1523,7 @@ static void setitemskip(mjuiSection* s, int pass) { -// Compute UI sizes: internal fuction, may be called twice per resize +// Compute UI sizes: internal function, may be called twice per resize static void tryresize(mjUI* ui, const mjrContext* con) { // scale theme sizes int w_master = SCL(ui->spacing.total, con); @@ -2969,7 +2969,7 @@ void mjui_render(mjUI* ui, const mjuiState* state, const mjrContext* con) { mjr_rectangle(r, ui->color.select2[0], ui->color.select2[1], ui->color.select2[2], 1); - // hightlight row under mouse + // highlight row under mouse int k = findselect(it, ui, state, con); if (k >= 0) { mjrRect r1 = r; diff --git a/src/user/user_composite.cc b/src/user/user_composite.cc index ab34b7b8..b90245cd 100644 --- a/src/user/user_composite.cc +++ b/src/user/user_composite.cc @@ -139,7 +139,7 @@ void mjCComposite::SetDefault(void) { } } - // set all deafult groups to 3 + // set all default groups to 3 for (int i=0; igroup = 3; def[i].spec.site->group = 3; diff --git a/src/user/user_flexcomp.cc b/src/user/user_flexcomp.cc index 7b1b0116..338c1896 100644 --- a/src/user/user_flexcomp.cc +++ b/src/user/user_flexcomp.cc @@ -1527,7 +1527,7 @@ void mjCFlexcomp::LoadGMSH22(char* buffer, int binary, int nodeend, // read elements, discard all tags element.reserve(numNodeTags*numElements); for (size_t i=0; i> tag >> elementType >> numTags; if (!ss.good()) { @@ -1535,7 +1535,7 @@ void mjCFlexcomp::LoadGMSH22(char* buffer, int binary, int nodeend, } } if (numTags > 0) { - ss >> physicalEntityTag >> elmentModelEntityTag; + ss >> physicalEntityTag >> elementModelEntityTag; if (!ss.good()) { throw mjCError(NULL, "Error reading Elements"); } diff --git a/src/user/user_model.cc b/src/user/user_model.cc index 532eece0..2a926855 100644 --- a/src/user/user_model.cc +++ b/src/user/user_model.cc @@ -131,7 +131,7 @@ mjCModel::mjCModel() { //------------------------ auto-computed statistics #ifndef MEMORY_SANITIZER - // initializing as best practice, but want MSAN to catch unintialized use + // initializing as best practice, but want MSAN to catch uninitialized use meaninertia_auto = 0; meanmass_auto = 0; meansize_auto = 0; @@ -1845,7 +1845,7 @@ void mjCModel::AutoSpringDamper(mjModel* m) { int adr = m->jnt_dofadr[n]; int ndim = mjCJoint::nv((mjtJoint)m->jnt_type[n]); - // get timeconst and dampratio from joint specificatin + // get timeconst and dampratio from joint specification mjtNum timeconst = (mjtNum)joints_[n]->springdamper[0]; mjtNum dampratio = (mjtNum)joints_[n]->springdamper[1]; diff --git a/src/user/user_objects.cc b/src/user/user_objects.cc index 82c46acd..c1f49f29 100644 --- a/src/user/user_objects.cc +++ b/src/user/user_objects.cc @@ -1123,7 +1123,7 @@ void mjCBody::NameSpace(const mjCModel* m) { -// apply prefix and suffix, propagate to all descendents or only to child bodies +// apply prefix and suffix, propagate to all descendants or only to child bodies void mjCBody::NameSpace_(const mjCModel* m, bool propagate) { mjCBase::NameSpace(m); if (!plugin_instance_name.empty()) { @@ -5487,7 +5487,7 @@ void mjCTendon::Compile(void) { case mjWRAP_PULLEY: // pulley should not follow other pulley if (i>0 && path[i-1]->type==mjWRAP_PULLEY) { - throw mjCError(this, "tendon '%s' (id = %d): consequtive pulleys (pos %d)", + throw mjCError(this, "tendon '%s' (id = %d): consecutive pulleys (pos %d)", name.c_str(), id, i); } diff --git a/src/user/user_resource.cc b/src/user/user_resource.cc index 980d7ee9..b82d7c0c 100644 --- a/src/user/user_resource.cc +++ b/src/user/user_resource.cc @@ -249,7 +249,7 @@ void mju_getResourceDir(mjResource* resource, const char** dir, int* ndir) { // return 0 if the resource's timestamp matches the provided timestamp -// return > 0 if the the resource is younger than the given timestamp +// return > 0 if the resource is younger than the given timestamp // return < 0 if the resource is older than the given timestamp int mju_isModifiedResource(const mjResource* resource, const char* timestamp) { // provider is not OS filesystem diff --git a/src/user/user_resource.h b/src/user/user_resource.h index 82a70ed6..1d2093b6 100644 --- a/src/user/user_resource.h +++ b/src/user/user_resource.h @@ -42,7 +42,7 @@ MJAPI int mju_readResource(mjResource* resource, const void** buffer); MJAPI void mju_getResourceDir(mjResource* resource, const char** dir, int* ndir); // return 0 if the resource's timestamp matches the provided timestamp -// return > 0 if the the resource is younger than the given timestamp +// return > 0 if the resource is younger than the given timestamp // return < 0 if the resource is older than the given timestamp MJAPI int mju_isModifiedResource(const mjResource* resource, const char* timestamp); diff --git a/src/user/user_util.cc b/src/user/user_util.cc index 803c22d4..db022bfb 100644 --- a/src/user/user_util.cc +++ b/src/user/user_util.cc @@ -993,7 +993,7 @@ std::string FilePath::PathReduce(const std::string& str) { int j = abs_prefix.size(); for (int i = j; i < str.size(); ++i) { - if (IsSeperator(str[i])) { + if (IsSeparator(str[i])) { std::string temp = str.substr(j, i - j); j = i + 1; if (temp == ".." && !dirs.empty() && dirs.back() != "..") { diff --git a/src/user/user_util.h b/src/user/user_util.h index 8a95d61e..1d516ab8 100644 --- a/src/user/user_util.h +++ b/src/user/user_util.h @@ -211,7 +211,7 @@ class FilePath { private: static std::string AbsPrefix(const std::string& str); static std::string PathReduce(const std::string& str); - static bool IsSeperator(char c) { + static bool IsSeparator(char c) { return c == '/' || c == '\\'; } static std::string Combine(const std::string& s1, const std::string& s2);