Split name2id and id2name into a separate source file.

PiperOrigin-RevId: 647373431
Change-Id: I3bab0ea7157750b79826739e3d739e4114fa0af7
This commit is contained in:
Saran Tunyasuvunakool
2024-06-27 10:49:25 -07:00
committed by Copybara-Service
parent 44be878e7e
commit 0e19722c61
8 changed files with 330 additions and 278 deletions
-14
View File
@@ -15,8 +15,6 @@
#ifndef MUJOCO_SRC_ENGINE_ENGINE_SUPPORT_H_
#define MUJOCO_SRC_ENGINE_ENGINE_SUPPORT_H_
#include <stdint.h>
#include <mujoco/mjdata.h>
#include <mujoco/mjexport.h>
#include <mujoco/mjmodel.h>
@@ -113,18 +111,6 @@ int mj_jacSum(const mjModel* m, mjData* d, int* chain,
MJAPI void mj_angmomMat(const mjModel* m, mjData* d, mjtNum* mat, int body);
//-------------------------- name functions --------------------------------------------------------
// get string hash, see http://www.cse.yorku.ca/~oz/hash.html
uint64_t mj_hashString(const char* s, uint64_t n);
// get id of object with the specified mjtObj type and name, returns -1 if id not found
MJAPI int mj_name2id(const mjModel* m, int type, const char* name);
// get name of object with the specified mjtObj type and id, returns NULL if name not found
MJAPI const char* mj_id2name(const mjModel* m, int type, int id);
//-------------------------- inertia functions -----------------------------------------------------
// convert sparse inertia matrix M into full matrix