我已经宣布这个类“机器人”:
#ifndef ROBOT_H
#define ROBOT_H
class Robot {
private:
static const int N_ROBOT_JOINTS = 5;
static const int JOINT_PARAM_D1 = 275;
static const int JOINT_PARAM_A2 = 200;
static const int JOINT_PARAM_A3 = 130;
static const int JOINT_PARAM_D5 = 130;
public:
Robot();
float* forwardKinematics(int theta[N_ROBOT_JOINTS]);
};
#endif
机器人.cpp
#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>
Robot::Robot(void)
{
}
float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];
float p_x, p_y, p_z, pitch, roll;
for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
{
}
return array_fwdKin;
}
但是当我尝试编译时,我得到了这个错误:
6 IntelliSense:成员“Robot::N_ROBOT_JOINTS”(在“e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h”的第 9 行声明)无法访问 e:\Documents\Visual Studio 2012\项目\机器人运动学\机器人运动学\Robot.cpp 10 43 机器人运动学