Difference between revisions of "Migrate Phidgets to catkin"

From wikidb
Jump to: navigation, search
(Created page with "= Background = <tt>motor_control_hc</tt> listens to <tt>odom</tt> and <tt>cmd_vel</tt> messages. Configuring this feedback system is intuitive and the control does not read...")
 
(Modifications to the motor controller)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Background =
 
= Background =
  
 +
THIS IS NO LONGER RELEVANT. THE PROBLEM WAS SOLVED WITH A LAUNCH SCRIPT.
 +
 
<tt>motor_control_hc</tt> listens to <tt>odom</tt> and <tt>cmd_vel</tt> messages. Configuring this feedback system is  
 
<tt>motor_control_hc</tt> listens to <tt>odom</tt> and <tt>cmd_vel</tt> messages. Configuring this feedback system is  
 
intuitive and the control does not read <tt>param</tt> values properly. The most straight forward means to debug the
 
intuitive and the control does not read <tt>param</tt> values properly. The most straight forward means to debug the
Line 8: Line 10:
  
 
* [http://wiki.ros.org/catkin/migrating_from_rosbuild Migrating from rosbuild]
 
* [http://wiki.ros.org/catkin/migrating_from_rosbuild Migrating from rosbuild]
 +
 +
= 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
 +
 +
* [[Phidgets CMakeLists]]
 +
* No modifications to <tt>package.xml</tt>.
 +
 +
= Execute =
 +
 +
* [[Phidgets Motor Controller Test]] provides test background.
 +
 +
  rosrun phidgets_cat motor_control_hc
 +
 +
= 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 motor_control_hc.cpp.org  motor_control_hc.cpp
 +
    509c509,510
 +
    <    std::string odometry_topic = "odom";
 +
    ---
 +
    >    //std::string odometry_topic = "odom";
 +
    >    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++.
 +
 +
= IGNORE =
 +
 +
THIS PROBLEM WAS SOLVED WITH A LAUNCH SCRIPT.
 +
 +
= Execute With Odometry =
 +
 +
In a new window execute odometry.
 +
 +
  roslaunch floor_hugger odometry.launch
 +
 +
Test with motor commands from [[Phidgets Motor Controller Test]] and observe odometry changes with.
 +
 +
  rostopic echo odom

Latest revision as of 16:07, 15 April 2016

Background

THIS IS NO LONGER RELEVANT. THE PROBLEM WAS SOLVED WITH A LAUNCH SCRIPT.

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 motor_control_hc.cpp.org  motor_control_hc.cpp
   509c509,510
   <     std::string odometry_topic = "odom";
   ---
   >     //std::string odometry_topic = "odom";
   >     std::string odometry_topic = "disable";

IGNORE

THIS PROBLEM WAS SOLVED WITH A LAUNCH SCRIPT.

Execute With Odometry

In a new window execute odometry.

 roslaunch floor_hugger odometry.launch

Test with motor commands from Phidgets Motor Controller Test and observe odometry changes with.

 rostopic echo odom