Robots/YouBot/lua_YouBotKinematics.cpp
// Center of mass with respect to the base (including the arm)
Center of mass with respect to the base (including the arm)
Center of mass with respect to the base ( including the arm )
static int lua_com_base(lua_State *L) {
	std::vector<double> q = lua_checkvector(L, 1);
	std::vector<double> comObject = lua_checkvector(L, 2);
	double mObject = luaL_checknumber(L, 3);
	std::vector<double> com = YouBot_kinematics_com_arm(&q[0],comObject,mObject);
	double mAugmented = mObject + mTotal;
	com[0] = (com[0] - comArm[0]) / mAugmented;
	com[1] = (com[1] - comArm[1]) / mAugmented;
	com[2] = (com[2] - comArm[2]) / mAugmented;
	lua_pushvector(L, com);
	return 1;
}
static int lua_com_base ( lua_State * L ) { std :: vector < double > q = lua_checkvector ( L , 1 ) ; std :: vector < double > comObject = lua_checkvector ( L , 2 ) ; double mObject = luaL_checknumber ( L , 3 ) ; std :: vector < double > com = YouBot_kinematics_com_arm ( & q [ 0 ] , comObject , mObject ) ; double mAugmented = mObject + mTotal ; com [ 0 ] = ( com [ 0 ] - comArm [ 0 ] ) / mAugmented ; com [ 1 ] = ( com [ 1 ] - comArm [ 1 ] ) / mAugmented ; com [ 2 ] = ( com [ 2 ] - comArm [ 2 ] ) / mAugmented ; lua_pushvector ( L , com ) ; return 1 ; }
Center of mass with respect to the base (including the arm)
Center of mass with respect to the base ( including the arm )