diff --git a/poppy_ros/poppy_ros.cpp b/poppy_ros/poppy_ros.cpp new file mode 100644 index 0000000..052cfc6 --- /dev/null +++ b/poppy_ros/poppy_ros.cpp @@ -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 ("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; +} \ No newline at end of file diff --git a/poppy_ros/src/poppy_ros.cpp b/poppy_ros/src/poppy_ros.cpp new file mode 100644 index 0000000..052cfc6 --- /dev/null +++ b/poppy_ros/src/poppy_ros.cpp @@ -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 ("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; +} \ No newline at end of file