Teacher code

This commit is contained in:
acombe 2023-12-20 08:57:36 +01:00
parent 0af8197c38
commit f722004317
2 changed files with 50 additions and 0 deletions

25
poppy_ros/poppy_ros.cpp Normal file
View File

@ -0,0 +1,25 @@
void Callback(msg) {
//create empty vector
//fill it with msg
//call sendTargetJointPosition
}
int main(int argc, char** argv) {
ros::init(argc, argv, "poppy_ros");
ros::NodeHandle nh;
ros::Publisher pub = nh.advertise <msg>("joint_position", 1);
ros::Subscriber sub = nh.subscribe("joint_cmd", 1, Callback);
ros::Rate loopRate(10);
while (ros::ok()) {
//create a msg
//call readCurrentJointPosition
//fill msg
//publish it
ros::spinOnce();
loopRate.sleep();
}
return 0;
}

View File

@ -0,0 +1,25 @@
void Callback(msg) {
//create empty vector
//fill it with msg
//call sendTargetJointPosition
}
int main(int argc, char** argv) {
ros::init(argc, argv, "poppy_ros");
ros::NodeHandle nh;
ros::Publisher pub = nh.advertise <msg>("joint_position", 1);
ros::Subscriber sub = nh.subscribe("joint_cmd", 1, Callback);
ros::Rate loopRate(10);
while (ros::ok()) {
//create a msg
//call readCurrentJointPosition
//fill msg
//publish it
ros::spinOnce();
loopRate.sleep();
}
return 0;
}