Fix typos.
PiperOrigin-RevId: 716211176 Change-Id: Ibadfe13db89ed9047832b977e918faa3c5c6d9f1
This commit is contained in:
committed by
Copybara-Service
parent
4da2ddce29
commit
893a993bf6
@@ -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
|
// callback for checking if the current resource was modified from the time
|
||||||
// specified by the timestamp
|
// specified by the timestamp
|
||||||
// returns 0 if the resource's timestamp matches the provided 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
|
// returns < 0 if the resource is older than the given timestamp
|
||||||
typedef int (*mjfResourceModified)(const mjResource* resource, const char* timestamp);
|
typedef int (*mjfResourceModified)(const mjResource* resource, const char* timestamp);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ mjfAct mjcb_act_dyn = 0;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// reset callbacks to defauls
|
// reset callbacks to defaults
|
||||||
void mj_resetCallbacks(void) {
|
void mj_resetCallbacks(void) {
|
||||||
mjcb_passive = 0;
|
mjcb_passive = 0;
|
||||||
mjcb_control = 0;
|
mjcb_control = 0;
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ int mjraw_CapsuleBox(mjContact* con, mjtNum margin,
|
|||||||
} else if (cltype >= 0 && cltype / 3 == 1) { // we are on box's edge
|
} else if (cltype >= 0 && cltype / 3 == 1) { // we are on box's edge
|
||||||
// hacks to find the relative orientation of capsule and edge
|
// hacks to find the relative orientation of capsule and edge
|
||||||
// there are 2 cases:
|
// 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!=2^n: oriented in a cross X configuration
|
||||||
|
|
||||||
c1 = axisdir ^ clcorner; // same trick
|
c1 = axisdir ^ clcorner; // same trick
|
||||||
|
|||||||
@@ -1153,7 +1153,7 @@ int mj_broadphase(const mjModel* m, mjData* d, int* bfpair, int maxpair) {
|
|||||||
|
|
||||||
// init with pairs involving always-colliding bodies
|
// init with pairs involving always-colliding bodies
|
||||||
for (int b1=0; b1 < nbody; b1++) {
|
for (int b1=0; b1 < nbody; b1++) {
|
||||||
// cannot colide
|
// cannot collide
|
||||||
if (!canCollide(m, b1)) {
|
if (!canCollide(m, b1)) {
|
||||||
continue;
|
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))) {
|
(m->body_weldid[b1] == 0 && hasPlane(m, b1))) {
|
||||||
// add b1:body pairs that are not welded together
|
// add b1:body pairs that are not welded together
|
||||||
for (int b2=0; b2 < nbody; b2++) {
|
for (int b2=0; b2 < nbody; b2++) {
|
||||||
// cannot colide
|
// cannot collide
|
||||||
if (!canCollide(m, b2)) {
|
if (!canCollide(m, b2)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
// 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];
|
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;
|
int shift = 0;
|
||||||
for (int r = 0; r < nv - 1; r++) {
|
for (int r = 0; r < nv - 1; r++) {
|
||||||
shift += d->C_rownnz[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);
|
ctx->nL = mju_cholFactorCount(ctx->L_rownnz, HT_rownnz, HT_rowadr, HT_colind, nv, d);
|
||||||
mj_freeStack(d);
|
mj_freeStack(d);
|
||||||
|
|
||||||
// compute L row adresses: rowadr = cumsum(rownnz)
|
// compute L row addresses: rowadr = cumsum(rownnz)
|
||||||
ctx->L_rowadr[0] = 0;
|
ctx->L_rowadr[0] = 0;
|
||||||
for (int r=1; r < nv; r++) {
|
for (int r=1; r < nv; r++) {
|
||||||
ctx->L_rowadr[r] = ctx->L_rowadr[r-1] + ctx->L_rownnz[r-1];
|
ctx->L_rowadr[r] = ctx->L_rowadr[r-1] + ctx->L_rownnz[r-1];
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ MJAPI void mju_boxQPmalloc(mjtNum** res, mjtNum** R, int** index,
|
|||||||
mjtNum** H, mjtNum** g, int n,
|
mjtNum** H, mjtNum** g, int n,
|
||||||
mjtNum** lower, mjtNum** upper);
|
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,
|
MJAPI int mju_boxQPoption(mjtNum* res, mjtNum* R, int* index,
|
||||||
const mjtNum* H, const mjtNum* g, int n,
|
const mjtNum* H, const mjtNum* g, int n,
|
||||||
const mjtNum* lower, const mjtNum* upper,
|
const mjtNum* lower, const mjtNum* upper,
|
||||||
|
|||||||
@@ -895,7 +895,7 @@ static void setVertexHaze(float* v, float az, float h, float r) {
|
|||||||
|
|
||||||
// truncated cone for haze rendering
|
// truncated cone for haze rendering
|
||||||
static void haze(int nSlice, float r, const float* rgba) {
|
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 alpha = atan2f(1, r);
|
||||||
float beta = (float)(0.75*mjPI) - alpha;
|
float beta = (float)(0.75*mjPI) - alpha;
|
||||||
float h = sqrtf(0.5f) * r * sinf(alpha) / sinf(beta);
|
float h = sqrtf(0.5f) * r * sinf(alpha) / sinf(beta);
|
||||||
|
|||||||
+3
-3
@@ -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) {
|
static int textwidth(const char* text, const mjrContext* con, int limit) {
|
||||||
int i = 0, width = 0;
|
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) {
|
static void tryresize(mjUI* ui, const mjrContext* con) {
|
||||||
// scale theme sizes
|
// scale theme sizes
|
||||||
int w_master = SCL(ui->spacing.total, con);
|
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],
|
mjr_rectangle(r, ui->color.select2[0],
|
||||||
ui->color.select2[1], ui->color.select2[2], 1);
|
ui->color.select2[1], ui->color.select2[2], 1);
|
||||||
|
|
||||||
// hightlight row under mouse
|
// highlight row under mouse
|
||||||
int k = findselect(it, ui, state, con);
|
int k = findselect(it, ui, state, con);
|
||||||
if (k >= 0) {
|
if (k >= 0) {
|
||||||
mjrRect r1 = r;
|
mjrRect r1 = r;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void mjCComposite::SetDefault(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set all deafult groups to 3
|
// set all default groups to 3
|
||||||
for (int i=0; i<mjNCOMPKINDS; i++) {
|
for (int i=0; i<mjNCOMPKINDS; i++) {
|
||||||
def[i].spec.geom->group = 3;
|
def[i].spec.geom->group = 3;
|
||||||
def[i].spec.site->group = 3;
|
def[i].spec.site->group = 3;
|
||||||
|
|||||||
@@ -1527,7 +1527,7 @@ void mjCFlexcomp::LoadGMSH22(char* buffer, int binary, int nodeend,
|
|||||||
// read elements, discard all tags
|
// read elements, discard all tags
|
||||||
element.reserve(numNodeTags*numElements);
|
element.reserve(numNodeTags*numElements);
|
||||||
for (size_t i=0; i<numElements; i++) {
|
for (size_t i=0; i<numElements; i++) {
|
||||||
int nodeTag = 0, physicalEntityTag = 0, elmentModelEntityTag = 0;
|
int nodeTag = 0, physicalEntityTag = 0, elementModelEntityTag = 0;
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
ss >> tag >> elementType >> numTags;
|
ss >> tag >> elementType >> numTags;
|
||||||
if (!ss.good()) {
|
if (!ss.good()) {
|
||||||
@@ -1535,7 +1535,7 @@ void mjCFlexcomp::LoadGMSH22(char* buffer, int binary, int nodeend,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (numTags > 0) {
|
if (numTags > 0) {
|
||||||
ss >> physicalEntityTag >> elmentModelEntityTag;
|
ss >> physicalEntityTag >> elementModelEntityTag;
|
||||||
if (!ss.good()) {
|
if (!ss.good()) {
|
||||||
throw mjCError(NULL, "Error reading Elements");
|
throw mjCError(NULL, "Error reading Elements");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ mjCModel::mjCModel() {
|
|||||||
|
|
||||||
//------------------------ auto-computed statistics
|
//------------------------ auto-computed statistics
|
||||||
#ifndef MEMORY_SANITIZER
|
#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;
|
meaninertia_auto = 0;
|
||||||
meanmass_auto = 0;
|
meanmass_auto = 0;
|
||||||
meansize_auto = 0;
|
meansize_auto = 0;
|
||||||
@@ -1845,7 +1845,7 @@ void mjCModel::AutoSpringDamper(mjModel* m) {
|
|||||||
int adr = m->jnt_dofadr[n];
|
int adr = m->jnt_dofadr[n];
|
||||||
int ndim = mjCJoint::nv((mjtJoint)m->jnt_type[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 timeconst = (mjtNum)joints_[n]->springdamper[0];
|
||||||
mjtNum dampratio = (mjtNum)joints_[n]->springdamper[1];
|
mjtNum dampratio = (mjtNum)joints_[n]->springdamper[1];
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
void mjCBody::NameSpace_(const mjCModel* m, bool propagate) {
|
||||||
mjCBase::NameSpace(m);
|
mjCBase::NameSpace(m);
|
||||||
if (!plugin_instance_name.empty()) {
|
if (!plugin_instance_name.empty()) {
|
||||||
@@ -5487,7 +5487,7 @@ void mjCTendon::Compile(void) {
|
|||||||
case mjWRAP_PULLEY:
|
case mjWRAP_PULLEY:
|
||||||
// pulley should not follow other pulley
|
// pulley should not follow other pulley
|
||||||
if (i>0 && path[i-1]->type==mjWRAP_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);
|
name.c_str(), id, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 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
|
// return < 0 if the resource is older than the given timestamp
|
||||||
int mju_isModifiedResource(const mjResource* resource, const char* timestamp) {
|
int mju_isModifiedResource(const mjResource* resource, const char* timestamp) {
|
||||||
// provider is not OS filesystem
|
// provider is not OS filesystem
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ MJAPI int mju_readResource(mjResource* resource, const void** buffer);
|
|||||||
MJAPI void mju_getResourceDir(mjResource* resource, const char** dir, int* ndir);
|
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 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
|
// return < 0 if the resource is older than the given timestamp
|
||||||
MJAPI int mju_isModifiedResource(const mjResource* resource, const char* timestamp);
|
MJAPI int mju_isModifiedResource(const mjResource* resource, const char* timestamp);
|
||||||
|
|
||||||
|
|||||||
@@ -993,7 +993,7 @@ std::string FilePath::PathReduce(const std::string& str) {
|
|||||||
int j = abs_prefix.size();
|
int j = abs_prefix.size();
|
||||||
|
|
||||||
for (int i = j; i < str.size(); ++i) {
|
for (int i = j; i < str.size(); ++i) {
|
||||||
if (IsSeperator(str[i])) {
|
if (IsSeparator(str[i])) {
|
||||||
std::string temp = str.substr(j, i - j);
|
std::string temp = str.substr(j, i - j);
|
||||||
j = i + 1;
|
j = i + 1;
|
||||||
if (temp == ".." && !dirs.empty() && dirs.back() != "..") {
|
if (temp == ".." && !dirs.empty() && dirs.back() != "..") {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class FilePath {
|
|||||||
private:
|
private:
|
||||||
static std::string AbsPrefix(const std::string& str);
|
static std::string AbsPrefix(const std::string& str);
|
||||||
static std::string PathReduce(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 == '\\';
|
return c == '/' || c == '\\';
|
||||||
}
|
}
|
||||||
static std::string Combine(const std::string& s1, const std::string& s2);
|
static std::string Combine(const std::string& s1, const std::string& s2);
|
||||||
|
|||||||
Reference in New Issue
Block a user