Migrate Phidgets to catkin
Contents
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
- Phidgets CMakeLists
- No modifications to package.xml.
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 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";
- rosparam
- Using the Parameter Server in C++.
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