33 #include <Rcs_macros.h> 34 #include <Rcs_typedef.h> 45 ball = RcsGraph_getBodyByName(graph,
"Ball");
47 plate = RcsGraph_getBodyByName(graph,
"Plate");
52 "The ball's parent must be NULL or the Plate, but was %s",
53 ball->parent ?
ball->parent->name :
"NULL");
56 RcsShape* plateShape = NULL;
57 RCSBODY_TRAVERSE_SHAPES(
plate) {
58 if (SHAPE->type == RCSSHAPE_BOX) {
64 RCHECK_MSG(plateShape != NULL,
"Plate body must have a box shape.");
83 double minDist = smallerExtent*0.6;
84 double maxDist = smallerExtent*0.8;
101 double ballX = std::cos(initialState->ele[1]) * initialState->ele[0];
102 double ballY = std::sin(initialState->ele[1]) * initialState->ele[0];
104 if (
ball->parent == NULL) {
106 ballX +=
plate->A_BI->org[0];
107 ballY +=
plate->A_BI->org[1];
111 double* ballRBJ = &
graph->q->ele[
ball->jnt->jointIndex];
virtual ~ISSBallOnPlate()
virtual std::vector< std::string > getNames() const
void applyInitialState(const MatNd *initialState) override
unsigned int getDim() const override
ISSBallOnPlate(RcsGraph *graph)
void getMinMax(double *min, double *max) const override