33 #include <Rcs_macros.h> 34 #include <Rcs_typedef.h> 54 if (prevBody !=
nullptr) {
62 zOffset = prevBody->A_BI->org[2];
65 if (prevBody->shape[
shapeIdxPrevBody]->type == RCSSHAPE_TYPE::RCSSHAPE_BOX) {
68 else if (prevBody->shape[
shapeIdxPrevBody]->type == RCSSHAPE_TYPE::RCSSHAPE_CYLINDER) {
71 else if (prevBody->shape[
shapeIdxPrevBody]->type == RCSSHAPE_TYPE::RCSSHAPE_SPHERE) {
76 std::cout <<
"No default vertical offset found for previous body shape " <<
77 prevBody->shape[0]->type << std::endl;
83 std::cout <<
"No reference body found for adding an offset to the randomized sphere's position! " <<
95 RLOG(4,
"New radius = %f; New z-position = %f", newRadius, zOffset + newRadius);
102 RCHECK_MSG(bodyParamInfo->
body->shape !=
nullptr,
"Invalid ball body %s", bodyParamInfo->
body->name);
103 RCHECK_MSG(bodyParamInfo->
body->shape[
shapeIdx] !=
nullptr,
"Invalid ball body %s", bodyParamInfo->
body->name);
104 RCHECK_MSG(bodyParamInfo->
body->shape[
shapeIdx]->type == RCSSHAPE_SPHERE,
"Invalid ball body %s",
105 bodyParamInfo->
body->name);
106 RCHECK_MSG((bodyParamInfo->
body->shape[
shapeIdx]->computeType & RCSSHAPE_COMPUTE_PHYSICS) != 0,
107 "Invalid ball body %s", bodyParamInfo->
body->name);
108 RCHECK_MSG(bodyParamInfo->
body->rigid_body_joints,
"Invalid ball body %s", bodyParamInfo->
body->name);
virtual void setValues(PropertySource *inValues)
virtual void init(BodyParamInfo *bodyParamInfo)
unsigned int shapeIdxPrevBody
The spheres's index within the previous body. This is given by the order of the shapes in the config ...
virtual void setValues(PropertySource *inValues)
virtual ~PPDSphereRadius()
virtual void init(BodyParamInfo *bodyParamInfo)
RcsGraph * graph
The graph containing the body.
PPDSphereRadius(std::string prevBodyName, unsigned int shapeIdx=0, unsigned int shapeIdxPrevBody=0)
std::string prevBodyName
Name of the previous body if the graph to which the sphere is placed relative to. ...
BodyParamInfo * bodyParamInfo
unsigned int shapeIdx
The spheres's index within given the body. This is given by the order of the shapes in the config xml...