5 #include <geometry_msgs/Pose.h>
6 #include <geometry_msgs/PoseStamped.h>
7 #include <geometry_msgs/TwistStamped.h>
8 #include <nav_msgs/Odometry.h>
15 #include <visp/vpRobotAfma6.h>
19 #ifdef VISP_HAVE_AFMA6
29 void setCameraVel(
const geometry_msgs::TwistStampedConstPtr & );
88 (boost::function<
void(
const geometry_msgs::TwistStampedConstPtr & ) >)boost::bind(
107 m_robot->init(
static_cast< vpAfma6::vpAfma6ToolType
>(
m_tool_type ), vpCameraParameters::perspectiveProjWithDistortion );
108 vpCameraParameters cam;
109 m_robot->getCameraParameters( cam, 640, 480 );
110 std::cout <<
"Camera parameters (640 x 480):\n" << cam << std::endl;
112 m_robot->setRobotState( vpRobot::STATE_VELOCITY_CONTROL );
134 m_robot->getPosition( vpRobot::ARTICULAR_FRAME,
m_q, timestamp );
146 vpColVector vel( 6 );
147 m_robot->getVelocity( vpRobot::CAMERA_FRAME, vel, timestamp );
148 geometry_msgs::TwistStamped vel_msg;
149 vel_msg.header.stamp =
ros::Time( timestamp );
150 vel_msg.twist.linear.x = vel[0];
151 vel_msg.twist.linear.y = vel[1];
152 vel_msg.twist.linear.z = vel[2];
153 vel_msg.twist.angular.x = vel[3];
154 vel_msg.twist.angular.y = vel[4];
155 vel_msg.twist.angular.z = vel[5];
168 vc[0] = msg->twist.linear.x;
169 vc[1] = msg->twist.linear.y;
170 vc[2] = msg->twist.linear.z;
172 vc[3] = msg->twist.angular.x;
173 vc[4] = msg->twist.angular.y;
174 vc[5] = msg->twist.angular.z;
179 m_robot->setVelocity( vpRobot::CAMERA_FRAME, vc );
184 #endif // #ifdef VISP_HAVE_AFMA6
189 #ifdef VISP_HAVE_AFMA6
195 if ( node.
setup() != 0 )
197 printf(
"Afma6 setup failed... \n" );
203 catch(
const vpException &e)
205 std::cout <<
"Catch exception: " << e.getMessage() << std::endl;
208 printf(
"\nQuitting... \n" );
210 printf(
"This node is node available since ViSP was \nnot build with Afma6 robot support...\n" );