Migrate Phidgets to catkin

From wikidb
Revision as of 10:56, 12 April 2016 by Edc (Talk | contribs)

Jump to: navigation, search

Background

motor_control_hc listens to odom and cmd_vel messages. Configuring this feedback system is intuitive and the control does not read param values properly. The most straight forward means to debug the controller was to port it to catkin. This page documents how that was done. Other Phidgets components should be similar.

Reference

Set Up Phidgets Catkin Package

 cd ~/catkin_ws_indigo/src
 
 catkin_create_pkg phidgets_cat std_msgs rospy roscpp
 
 cd ..
 
 catkin_make
 
 cd src/phidgets_cat/
 
 cp ~/ros_packages/phidgets/src/motor_control_hc.cpp src
 
 cp ~/ros_packages/phidgets/msg_gen/cpp/include/phidgets/motor_params.h include/phidgets_cat
 
 emacs CMakeLists.txt&
 
 emacs package.xml&
 
 cd ..
 
 catkin_make

Execute

 rosrun phidgets_cat motor_control_hc

Modifications to the motor controller

The odometry_topic is changed to disable. There are no disable messages so the odometry callbacks are not called. There is now no feedback so that the motor controller responds in a primitive way to cmd_vel messages. In particular its PID capability is disabled.

This should be doable by using rosparam settings.

 diff src/motor_control_hc.cpp.org  src/motor_control_hc.cpp
   389c389,390
   <     std::string odometry_topic = "odom";
   ---
   >     //std::string odometry_topic = "odom";
   >     std::string odometry_topic = "disable";