Difference between revisions of "Migrate Phidgets to catkin"

From wikidb
Jump to: navigation, search
(Set Up Phidgets Catkin Package)
(Modifications to the motor controller)
Line 43: Line 43:
  
 
= Modifications to the motor controller =
 
= Modifications to the motor controller =
 +
 +
The odometry_topic is changed to <tt>disable</tt>. 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 <tt>cmd_vel</tt> messages. In particular its PID capability is disabled.
 +
 +
This should be doable by using <tt>rosparam</tt> settings.
  
 
   diff src/motor_control_hc.cpp.org  src/motor_control_hc.cpp
 
   diff src/motor_control_hc.cpp.org  src/motor_control_hc.cpp
Line 50: Line 54:
 
     >    //std::string odometry_topic = "odom";
 
     >    //std::string odometry_topic = "odom";
 
     >    std::string odometry_topic = "disable";
 
     >    std::string odometry_topic = "disable";
 +
 +
* [http://wiki.ros.org/rosparam rosparam]
 +
* Using the [http://wiki.ros.org/roscpp/Overview/Parameter%20Server Parameter Server] in C++.

Revision as of 10:56, 12 April 2016

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";