├── urdf ├── shrek.stl ├── main.xacro ├── head.xacro └── arm.xacro ├── src └── main.cpp ├── config └── joints.yaml ├── CMakeLists.txt ├── package.xml ├── launch └── gazebo.launch └── README.md /urdf/shrek.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utra-robosoccer/Tutorials-2020/HEAD/urdf/shrek.stl -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) { 4 | std::cout << "Hello World!\n"; 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /config/joints.yaml: -------------------------------------------------------------------------------- 1 | joint_state_controller: 2 | type: "joint_state_controller/JointStateController" 3 | publish_rate: 50 4 | 5 | head_controller: 6 | type: "position_controllers/JointPositionController" 7 | joint: base_to_head 8 | 9 | right_arm_controller: 10 | type: "velocity_controllers/JointVelocityController" 11 | joint: base_to_right_arm 12 | 13 | left_arm_controller: 14 | type: "velocity_controllers/JointVelocityController" 15 | joint: base_to_left_arm 16 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(tutorial) 3 | 4 | ## Find catkin macros and libraries 5 | find_package(catkin REQUIRED COMPONENTS roscpp std_msgs) 6 | 7 | catkin_package() 8 | 9 | ## Specify additional locations of header files 10 | ## Your package locations should be listed before other locations 11 | include_directories(include ${catkin_INCLUDE_DIRS}) 12 | 13 | add_executable(my_publisher src/main.cpp) 14 | target_link_libraries(my_publisher ${catkin_LIBRARIES}) 15 | 16 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tutorial 4 | 0.0.0 5 | The tutorial package contains example robot 6 | nam 7 | TODO 8 | 9 | catkin 10 | controller_manager 11 | diff_drive_controller 12 | gazebo_ros 13 | gazebo_ros_control 14 | joint_state_controller 15 | position_controllers 16 | velocity_controllers 17 | robot_state_publisher 18 | rqt_robot_steering 19 | rviz 20 | xacro 21 | 22 | -------------------------------------------------------------------------------- /urdf/main.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | / 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /urdf/head.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | transmission_interface/SimpleTransmission 38 | 39 | 1 40 | 41 | 42 | hardware_interface/PositionJointInterface 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /launch/gazebo.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Winter Break Tutorials 2 | 3 | - Slides can be found [here](https://docs.google.com/presentation/d/13XCDx3GYOWQLYuZl6OiorKB5LQHKp4tY2wDdE2C2mO4/edit#slide=id.p). 4 | - The urdf portion is based on this [ROS tutorial](https://wiki.ros.org/urdf/Tutorials/Building%20a%20Visual%20Robot%20Model%20with%20URDF%20from%20Scratch) 5 | - The publisher portion is based on this [ROS tutorial](https://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29) 6 | 7 | ## Prerequisites 8 | - have ubuntu and ROS installed 9 | 10 | ## Cloning the repo 11 | From home directory create /catkin_ws/src folder and run the following command 12 | ``` 13 | mkdir -p catkin_ws/src 14 | cd catkin_ws/src 15 | git clone https://github.com/utra-robosoccer/Tutorials-2020.git 16 | ``` 17 | 18 | ## Updating Dependencies 19 | ``` 20 | cd ~/catkin_ws/ 21 | rosdep update 22 | rosdep install --from-paths src --ignore-src -r -y --rosdistro melodic 23 | ``` 24 | 25 | ## Installing Controllers For Robot 26 | ``` 27 | sudo apt-get update 28 | sudo apt-get install ros-noetic-ros-controllers 29 | ``` 30 | 31 | 32 | ## Building tutorial package 33 | First build the project and source the setup file so that the system knows where to look for your build files 34 | ``` 35 | cd ~/catkin_ws 36 | catkin build tutorial 37 | source devel/setup.bash 38 | ``` 39 | 40 | ## Launch the robot 41 | ``` 42 | roslaunch tutorial gazebo.launch 43 | ``` 44 | 45 | 46 | ## Commands used during tutorial 47 | useful tip: press tab to auto-complete words as you type commands 48 | Open a new terminal to run commands for the robot 49 | 50 | ``` 51 | cd ~/catkin_ws 52 | source devel/setup.bash 53 | ``` 54 | To run the main node run this command 55 | ``` 56 | rosrun tutorial my_publisher 57 | ``` 58 | 59 | To send a command to the left arm 60 | ``` 61 | rostopic pub /left_arm_controller/command std_msgs/Float64 "data: 1.0" 62 | ``` 63 | 64 | To see the ROS node tree run this command 65 | ``` 66 | rqt_graph 67 | ``` 68 | -------------------------------------------------------------------------------- /urdf/arm.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | transmission_interface/SimpleTransmission 39 | 40 | 1 41 | 42 | 43 | hardware_interface/VelocityJointInterface 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | --------------------------------------------------------------------------------