Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1441

Moving the robot to a new position 90 mm to the left

$
0
0
Can anyone help me with this i need to pickup some screws from the same places and each time i need to go pack 90 mm to the left. Bellow is my code planner.manualPose ("pose1",25.0) is the position i need to change every time the robot completes a circle. If anyone can help would be appreciated, thank you! #include #include #include "std_msgs/MultiArrayLayout.h" #include "std_msgs/MultiArrayDimension.h" #include "std_msgs/Int32MultiArray.h" #include "tf2_ros/transform_listener.h" #include "tf2_geometry_msgs/tf2_geometry_msgs.h" int main(int argc, char **argv) { ros::init(argc, argv, "robot"); ros::AsyncSpinner async_spinner(1); async_spinner.start(); ros::NodeHandle nh; ros::NodeHandle private_node_handle ("~"); std::string base_frame; private_node_handle.param("base_frame", base_frame, "world"); ros::Publisher hand_control_pub = nh.advertise("hand_control", 100); int array[] = {0,0,0,0}; std::vector hand_target (array, array + sizeof(array) / sizeof(int) ); std_msgs::Int32MultiArray pub_msg; ScanNPlan planner(nh, false); ros::Duration(.5).sleep(); // wait for the class to initialize ros::Rate loop_rate(1); //-- The main loop while (ros::ok()) { planner.manualPose("pose1", 25.0); planner.manualPose("pose2",10.0); planner.manualPose("pose3", 25.0); planner.manualPose("pose4",25.0); planner.manualPose("pose5",25.0); planner.manualPose("pose6",10.0); planner.manualPose("pose7",25.0); ros::spinOnce(); loop_rate.sleep(); } ros::waitForShutdown(); }

Viewing all articles
Browse latest Browse all 1441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>