Phidgets Motor Encoder

From wikidb
Jump to: navigation, search

References

Check

 rosrun phidgets manager
   |-   # -|-              Type              -|- Serial No. -|-  Version -|
   |-------|----------------------------------|--------------|------------|
   |-   0 -|-                 PhidgetEncoder -|-     351673 -|-      302 -|
   |-------|----------------------------------|--------------|------------|
   |-   1 -|-            PhidgetInterfaceKit -|-      69535 -|-      825 -|
   |-------|----------------------------------|--------------|------------|
   |-   2 -|-            PhidgetMotorControl -|-     147489 -|-      102 -|
   |-------|----------------------------------|--------------|------------|
   |-   3 -|-                 PhidgetEncoder -|-     351547 -|-      302 -|
   |-------|----------------------------------|--------------|------------|

Modified the serial numbers for the left and right encoders in the odometry.launch file in the ..../floor_hugger/launch directory.

 diff odometry.launch.org odometry.launch
   15c15
   <         <param name="serial" value="52980" />
   ---
   >         <param name="serial" value="351547" />
   19c19
   <         <param name="serial" value="54104" />
   ---
   >         <param name="serial" value="351673" />
   24,25c24,25
   <         <param name="serialleft" value="52980" />
   <         <param name="serialright" value="54104" />
   ---
   >         <param name="serialleft" value="351547" />
   >         <param name="serialright" value="351673" />

Execute

Terminal 1

 roscore

Terminal 2

 roslaunch floor_hugger odometry.launch
   ... logging to /home/eepp/.ros/log/184aed3a-ee5e-11e5-86af-7c5cf84b92a4/roslaunch-hood-4875.log
   Checking log directory for disk usage. This may take awhile.
   Press Ctrl-C to interrupt
   Done checking log file disk usage. Usage is <1GB.
   
   started roslaunch server http://hood:48802/

   SUMMARY
   ========

   PARAMETERS
    * /encoder_left/serial: 351547
    * /encoder_right/serial: 351673
    * /odometry/countspermmleft: 100
    * /odometry/countspermmright: 100
    * /odometry/serialleft: 351547
    * /odometry/serialright: 351673
    * /odometry/verbose: True
    * /odometry/wheelbase: 400
    * /rosdistro: indigo
    * /rosversion: 1.11.16
 
   NODES
     /
       encoder_left (phidgets/high_speed_encoder)
       encoder_right (phidgets/high_speed_encoder)
       odometry (phidgets/odometry)
 
   ROS_MASTER_URI=http://hood:11311

   core service [/rosout] found
   process[encoder_left-1]: started with pid [4893]
   process[encoder_right-2]: started with pid [4894]
   process[odometry-3]: started with pid [4910]
   [ INFO] [1458453025.200790426]: Left encoder: phidgets/encoder/351547
   [ INFO] [1458453025.205863972]: Right encoder: phidgets/encoder/351673

Terminal 3

This example shows the topic echo while one motor is powered without it be connected to a Phidgets motor driver. The "pose" section displays the current position. The "twist" section displays the change in position impacted by the twist of the robot.

 rostopic echo odom
   ---
   header: 
     seq: 35304
     stamp: 
       secs: 1458454629
       nsecs: 943339159
     frame_id: odom
   child_frame_id: base_link
   pose: 
     pose: 
       position: 
         x: -0.300059982299
         y: 0.565528418531
         z: 0.0
       orientation: 
         x: -0.0
         y: 0.0
         z: 0.151113732152
         w: -0.988516383251
     covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
   twist: 
     twist: 
       linear: 
         x: 0.0177976840035
         y: -0.00553014091365
         z: 0.0
       angular: 
         x: 0.0
         y: 0.0
         z: -0.093185371335
     covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
   ---