Difference between revisions of "Adapting SyRoTek Intro to ROS Code"

From wikidb
Jump to: navigation, search
(Modifications)
Line 4: Line 4:
 
* [https://www.researchgate.net/publication/229003977_Syrotek_a_robotic_system_for_education paper]
 
* [https://www.researchgate.net/publication/229003977_Syrotek_a_robotic_system_for_education paper]
 
* [https://www.researchgate.net/publication/221130409_A_Technical_Solution_of_a_Robotic_e-Learning_System_in_the_SyRoTek_Project SyRoTek Paper]
 
* [https://www.researchgate.net/publication/221130409_A_Technical_Solution_of_a_Robotic_e-Learning_System_in_the_SyRoTek_Project SyRoTek Paper]
 
= MathJax =
 
 
* [https://www.mathjax.org MathJax Org]
 
* [http://docs.mathjax.org/en/latest/start.html Getting Started]
 
* [http://www.colorado.edu/physics/phys4610/phys4610_sp15/PHYS4610_sp15/Home_files/LaTeXSymbols.pdf LeTeX Symbols]
 
* [http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference Tutorial]
 
  
 
= Code Download =
 
= Code Download =
Line 97: Line 90:
 
Watch the odomometry messages in another terminal
 
Watch the odomometry messages in another terminal
 
   rostopic echo odom
 
   rostopic echo odom
 +
 +
= MathJax =
 +
 +
* [https://www.mathjax.org MathJax Org]
 +
* [http://docs.mathjax.org/en/latest/start.html Getting Started]
 +
* [http://www.colorado.edu/physics/phys4610/phys4610_sp15/PHYS4610_sp15/Home_files/LaTeXSymbols.pdf LeTeX Symbols]
 +
* [http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference Tutorial]

Revision as of 17:55, 11 May 2016

References

Code Download

PID

 tar xzf dem_pid.tar.gz

Dead Reckoning

Got it from the SyRoTek lesson web pages.

Setting up the project

Build

 cd /home/eepp/catkin_ws_indigo/src
 
 catkin_create_pkg syrotek roscpp rospy std_msgs
 
 cd ..
 
 catkin_make

Update Meta Files

 emacs CMakeList.txt

added the following to the end

   # for DeadReckoning
   set (SRCS1 ${SRCS1} src/myPoint.cpp)
   set (SRCS1 ${SRCS1} src/node_pid.cpp)
   set (SRCS1 ${SRCS1} src/pid.cpp)
   set (SRCS2 ${SRCS2} src/node_deadReckoningI.cpp)
   set (SRCS2 ${SRCS2} src/deadReckoningI.cpp)
   include_directories(include ${catkin_INCLUDE_DIRS})
   add_executable(cmd ${SRCS1})
   target_link_libraries(cmd ${catkin_LIBRARIES})
   add_executable(deadReckoningReg ${SRCS2})
   target_link_libraries(deadReckoningReg ${catkin_LIBRARIES})
   
   # for PID
   add_executable(pid ${SRCS1})
   target_link_libraries(pid ${catkin_LIBRARIES})
   add_dependencies(pid beginner_tutorials_generate_message_cpp)

Put the source in place

 roscd syrotek/
 
 ll src
     -rw-rw-r-- 1 eepp eepp 1022 May  9 12:10 deadReckoningI.cpp
     -rw-rw-r-- 1 eepp eepp  525 May  9 13:28 myPoint.cpp
     -rw-rw-r-- 1 eepp eepp 3105 May  9 12:09 node_deadReckoningI.cpp
     -rw-rw-r-- 1 eepp eepp 4125 May  9 13:29 node_pid.cpp
     -rw-rw-r-- 1 eepp eepp 2766 May  9 18:35 pid.cpp
 
 ll include
     -rw-rw-r-- 1 eepp eepp  924 May  9 13:27 myPoint.h
     -rw-rw-r-- 1 eepp eepp 1968 May  9 13:36 node_deadReckoningI.h
     -rw-rw-r-- 1 eepp eepp 2997 May  9 13:27 node_pid.h

Modifications

 diff pid.cpp.org pid.cpp
     13c13
     < #define MAX_SPEED 0.5         //!<Maximum speed of robot.
     ---
     > #define MAX_SPEED 5.0         //!<Maximum speed of robot.

Execute

Terminal 1

 roscore

Terminal 2

 roslaunch floor_hugger motor_control.launch 

Terminal 3

 roslaunch floor_hugger odometry.launc

Terminal 4

 rosrun syrotek pid -f 0.4

or

 rosrun syrotek cmd -f 0.4

Watch the odomometry messages in another terminal

 rostopic echo odom

MathJax