修正初始链接

This commit is contained in:
zj
2025-11-20 10:38:02 +08:00
parent 63cee48b82
commit e831c50c67

View File

@@ -11,7 +11,7 @@ float g_leftArmJoints[COLLISION_CHECK_SIMPLE_CNT][USED_ARM_DOF] = {0};
float g_rightArmJoints[COLLISION_CHECK_SIMPLE_CNT][USED_ARM_DOF] = {0};
float g_otherJoints[COLLISION_CHECK_SIMPLE_CNT][USED_OTHER_DOF] = {0};
const std::string g_bodyStartName[BODY_CNT] = {"LeftLink1", "RightLink1", "base_link"};
const std::string g_bodyStartName[BODY_CNT] = {"base_link_leftarm", "base_link_rightarm", "base_link"};
static float zeroFixedAngle = 0;
@@ -607,7 +607,10 @@ int CollisionSimulator::CheckBodyAngleLimit(int simple, int bodyType)
int CollisionSimulator::CheckArmJointsAngleLimit(float *joints)
{
CollisionStructureInfo *colStruct = &collision_structures_[g_linkStartIndex[BODY_TYPE_LEFT_ARM]];
int jointIndex2 = colStruct->jointIndexList[0];
JointsInfo *jointInfo2 = &jointMap_[jointIndex2];
RCLCPP_INFO(rclcpp::get_logger(GET_FUNC_LINE_STR()), "first link:%s, first joint:%s",
colStruct->link_name.c_str(), jointInfo2->name.c_str());
std::vector<CollisionStructureInfo *> child = {colStruct};
int childIndex = 0;
int childCnt = 1;