Closed hjed closed 10 years ago
Ok, I'm going to be away tomorrow but I did start on this last week.
The setup for it broke the make process for making the husky move however so I haven't submited it to git. The message class is ensor_msgs::JoinState::ConstPtr&, but I hadn't worked out how to extract data from it yet. You need to look at the ros documentation to work it out. Here is the code for reading from the encoders /*
Date 22/03/2014 */
void reciveMsg(const sensor_msgs::JoinState::ConstPtr& msg) { ROS_INFO("recived a message"); }
int main(int argc, char\ argv) {
//initialise the ros package ros::init(argc, argv, "encoderLogger");
//a nodehandler is used to communiate with the rest of ros ros::NodeHandle n;
//pass the void that is called when a message is recived ros::Subscriber sub = n.subscribe("/joint_states", 1000, reciveMsg);
//loop with callbacks ros::spin();
return 0; }
This is written from the rostopic /joint_states ATM, this can be read using "rostopic echo /joint_states"