├── .gitignore ├── trobo_description ├── CMakeLists.txt ├── package.xml └── urdf │ └── trobo.xacro ├── minimum_ros_control ├── CMakeLists.txt ├── launch │ └── trobo_world.launch └── package.xml ├── README.md └── trobo_control ├── src ├── trobo_control.cpp └── trobo_hw.cpp ├── include └── trobo_control │ └── trobo_hw.h ├── package.xml ├── CMakeLists.txt └── launch └── trobo_control.launch /.gitignore: -------------------------------------------------------------------------------- 1 | # Emacs Files 2 | .#* 3 | 4 | 5 | # Allow user to enable or disable this w/o changing repo 6 | rrbot_gazebo_plugins/CATKIN_IGNORE 7 | 8 | # OSX Files 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /trobo_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(trobo_description) 3 | 4 | find_package(catkin REQUIRED) 5 | 6 | catkin_package() 7 | 8 | install(DIRECTORY urdf 9 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 10 | -------------------------------------------------------------------------------- /minimum_ros_control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(minimum_ros_control) 3 | 4 | find_package(catkin REQUIRED) 5 | 6 | catkin_package() 7 | 8 | install(DIRECTORY launch 9 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # minimum_ros_control 2 | * Author: Kenta Yonekura 3 | * License: GNU General Public License, version 3 (GPL-3.0) 4 | * Inception Date: 4 June 2013 5 | * Version: 1.0.0 6 | 7 | This is a minimum sample to use ros_control without gazebo. 8 | 9 | ## Develop and Contribute 10 | 11 | This project is forked from gazebo_ros_demos. 12 | -------------------------------------------------------------------------------- /minimum_ros_control/launch/trobo_world.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /trobo_description/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | trobo_description 4 | 0.0.0 5 | The trobo_description package 6 | 7 | Kenta Yonekura 8 | 9 | BSD 10 | 11 | Dave Coleman 12 | 13 | catkin 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /minimum_ros_control/package.xml: -------------------------------------------------------------------------------- 1 | 2 | minimum_ros_control 3 | 0.1.0 4 | minimum_ros_control 5 | Kenta Yonekura 6 | 7 | BSD 8 | 9 | Kenta Yonekura 10 | 11 | catkin 12 | 13 | trobo_description 14 | trobo_control 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /trobo_control/src/trobo_control.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | ros::init(argc, argv, "trobo_control"); 8 | ros::NodeHandle nh; 9 | 10 | TRobo trobo; 11 | controller_manager::ControllerManager cm(&trobo, nh); 12 | 13 | ros::AsyncSpinner spinner(1); 14 | spinner.start(); 15 | 16 | while(ros::ok()) 17 | { 18 | ros::Time now = trobo.getTime(); 19 | ros::Duration dt = trobo.getPeriod(); 20 | 21 | trobo.read(now, dt); 22 | cm.update(now, dt); 23 | 24 | trobo.write(now, dt); 25 | dt.sleep(); 26 | } 27 | spinner.stop(); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /trobo_control/include/trobo_control/trobo_hw.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class TRobo : public hardware_interface::RobotHW 10 | { 11 | public: 12 | TRobo(); 13 | 14 | ros::Time getTime() const { return ros::Time::now(); } 15 | ros::Duration getPeriod() const { return ros::Duration(0.01); } 16 | 17 | void read(ros::Time, ros::Duration); 18 | 19 | void write(ros::Time, ros::Duration); 20 | 21 | protected: 22 | hardware_interface::JointStateInterface jnt_state_interface; 23 | hardware_interface::EffortJointInterface jnt_eff_interface; 24 | double cmd_[1]; 25 | double pos_[1]; 26 | double vel_[1]; 27 | double eff_[1]; 28 | 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /trobo_control/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | trobo_control 4 | 0.0.0 5 | The trobo_control package 6 | 7 | Kenta Yonekura 8 | 9 | BSD 10 | 11 | Dave Coleman 12 | 13 | catkin 14 | roscpp 15 | hardware_interface 16 | transmission_interface 17 | controller_manager 18 | 19 | roscpp 20 | hardware_interface 21 | transmission_interface 22 | controller_manager 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /trobo_control/src/trobo_hw.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include // for debug 6 | #include 7 | 8 | TRobo::TRobo() 9 | { 10 | // connect and register the joint state interface 11 | hardware_interface::JointStateHandle state_handle_1("joint1", &pos_[0], &vel_[0], &eff_[0]); 12 | jnt_state_interface.registerHandle(state_handle_1); 13 | registerInterface(&jnt_state_interface); 14 | 15 | // connect and register the joint position interface 16 | hardware_interface::JointHandle pos_handle_1(jnt_state_interface.getHandle("joint1"), &cmd_[0]); 17 | jnt_eff_interface.registerHandle(pos_handle_1); 18 | registerInterface(&jnt_eff_interface); 19 | } 20 | 21 | void TRobo::read(ros::Time time, ros::Duration period) 22 | { 23 | } 24 | 25 | void TRobo::write(ros::Time time, ros::Duration period) 26 | { 27 | //pos_[0] = cmd_[0]; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /trobo_control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(trobo_control) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | hardware_interface 7 | transmission_interface 8 | controller_manager 9 | ) 10 | 11 | catkin_package( 12 | INCLUDE_DIRS include 13 | # LIBRARIES trobo_control 14 | CATKIN_DEPENDS roscpp hardware_interface transmission_interface controller_manager 15 | # DEPENDS system_lib 16 | ) 17 | 18 | include_directories( 19 | include 20 | ${catkin_INCLUDE_DIRS} 21 | ) 22 | 23 | add_executable(trobo_control src/trobo_control.cpp src/trobo_hw.cpp) 24 | 25 | target_link_libraries(trobo_control 26 | ${catkin_LIBRARIES} 27 | ) 28 | 29 | install(TARGETS trobo_control 30 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 31 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 32 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 33 | ) 34 | 35 | install(DIRECTORY launch 36 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 37 | -------------------------------------------------------------------------------- /trobo_control/launch/trobo_control.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | trobo: 5 | # Publish all joint states ----------------------------------- 6 | joint_state_controller: 7 | type: joint_state_controller/JointStateController 8 | publish_rate: 100 9 | 10 | # Position Controllers --------------------------------------- 11 | joint1_position_controller: 12 | type: effort_controllers/JointPositionController 13 | joint: joint1 14 | pid: {p: 10.0, i: 0.0, d: 0.0} 15 | 16 | 17 | 18 | 20 | 21 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /trobo_description/urdf/trobo.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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 86 | 87 | 88 | 89 | 90 | transmission_interface/SimpleTransmission 91 | 92 | EffortJointInterface 93 | 94 | 95 | EffortJointInterface 96 | 1 97 | 98 | 99 | 100 | 101 | --------------------------------------------------------------------------------