Skip to content

Commit

Permalink
initial commit - still many things todo
Browse files Browse the repository at this point in the history
  • Loading branch information
smhaller committed Dec 14, 2018
0 parents commit b985625
Show file tree
Hide file tree
Showing 93 changed files with 310,011 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dobot M1 ROS Control
There are following directories available:

debot_m1: Meta-Package
dobot_m1_description: urdf and meshes
dobot_m1_hw: ros control/hardware interface using dobot PTPCmd interface
dobot_m1_moveit: moveit configuration
dobot_demo: simple point to point demo


## Starting the package:
roslaunch dobot_m1 dobot_m1.launch

## ToDo
- Fix Simulation in Gazebo

4 changes: 4 additions & 0 deletions dobot_m1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
project(dobot_m1)
find_package(catkin REQUIRED)
catkin_metapackage()
19 changes: 19 additions & 0 deletions dobot_m1/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<package format="2">
<name>dobot_m1</name>
<version>0.0.1</version>
<description>
Dobot M1 ROS meta-package containing dobot_m1 pkgs.
</description>
<maintainer email="[email protected]">Simon Haller</maintainer>
<license>GPLv2</license>

<buildtool_depend>catkin</buildtool_depend>

<!--> PACKAGES </-->
<exec_depend>dobot_m1_description</exec_depend>
<exec_depend>dobot_m1_hw</exec_depend>

<export>
<metapackage/>
</export>
</package>
23 changes: 23 additions & 0 deletions dobot_m1_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 2.8.3)
project(dobot_m1_demos)

find_package(catkin REQUIRED COMPONENTS
rospy
trajectory_msgs
message_generation
)

generate_messages(
DEPENDENCIES
std_msgs
trajectory_msgs
)

catkin_package(
CATKIN_DEPENDS message_runtime
)

include_directories(
${catkin_INCLUDE_DIRS}
)

19 changes: 19 additions & 0 deletions dobot_m1_demos/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package format="2">
<name>dobot_m1_demos</name>
<version>0.0.1</version>
<description>
simple demos for Dobot M1
</description>
<maintainer email="[email protected]">Simon Haller</maintainer>
<license>GPLv2</license>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_depend>trajectory_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_export_depend>rospy</build_export_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>trajectory_msgs</exec_depend>
</package>
47 changes: 47 additions & 0 deletions dobot_m1_demos/src/dobot-move-position.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/python
import rospy
from trajectory_msgs.msg import JointTrajectory
from trajectory_msgs.msg import JointTrajectoryPoint
import time

msg= JointTrajectory()
msg.joint_names=['dobot_m1_z_axis_joint', 'dobot_m1_axis_2_joint', 'dobot_m1_axis_3_joint', 'dobot_m1_axis_4_joint']

point=JointTrajectoryPoint()
Pos0=[0.23, -1.2, 1.5, 1.5]
Pos1=[0.2, 0, 0, 0]
Pos2=[0.15, 1.2, -1.5, -1.5]


def goTo(pub, pos):
point.time_from_start=rospy.Duration(0.1)
point.positions=pos
msg.points=[point]
pub.publish(msg)


def main():
rospy.init_node("Demo-Dobot")
rate=rospy.Rate(1)
pub=rospy.Publisher('/dobby/joint_trajectory_controller/command', JointTrajectory, queue_size=1)

raw_input("Press any key to continue with step")
goTo(pub, Pos1)
rate.sleep()

raw_input("Press any key to continue with step")
goTo(pub, Pos0)
rate.sleep()

raw_input("Press any key to continue with step")
goTo(pub, Pos1)
rate.sleep()

raw_input("Press any key to continue with step")
goTo(pub, Pos2)
rate.sleep()

if __name__ == "__main__":
main()


129 changes: 129 additions & 0 deletions dobot_m1_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
cmake_minimum_required(VERSION 2.8.3)
project(dobot_m1_description)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs # Or other packages containing msgs
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES kit_headtest
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)

## Declare a cpp library
# add_library(kit_headtest
# src/${PROJECT_NAME}/kit_headtest.cpp
# )

## Declare a cpp executable
# add_executable(kit_headtest_node src/kit_headtest_node.cpp)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(kit_headtest_node kit_headtest_generate_messages_cpp)

## Specify libraries to link a library or executable target against
# target_link_libraries(kit_headtest_node
# ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS kit_headtest kit_headtest_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_kit_headtest.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
Binary file not shown.
8 changes: 8 additions & 0 deletions dobot_m1_description/launch/display.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<launch>
<arg name="gui" default="True" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find dobot_m1_description)/robot/dobot_m1_in_world.urdf.xacro"/>
<param name="use_gui" value="$(arg gui)"/>

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>
72 changes: 72 additions & 0 deletions dobot_m1_description/launch/dobot-m1.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<launch>
<!-- LAUNCH INTERFACE -->
<arg name="gui" default="true" />
<arg name="robot_name" default="dobby"/>
<arg name="use_rviz" default="true"/>
<arg name="use_joint_state_publisher" default="true"/>
<arg name="use_robot_sim" default="true"/>
<arg name="load_moveit" default="true"/>

<param name="robot_description" command="$(find xacro)/xacro --inorder $(find dobot_m1_description)/robot/dobot_m1_in_world.urdf.xacro"/>


<group if="$(arg use_joint_state_publisher)">
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="use_gui" value="$(arg gui)"/>
<rosparam param="source_list">[/dobby/joint_states]</rosparam>
</node>
</group>

<param name="publish_frequency" value="100"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

<group if="$(arg use_rviz)">
<node name="my_rviz" pkg="rviz" type="rviz" respawn="false" args="-d $(find dobot_m1_description)/launch/rviz_config.rviz" output="screen"/>
</group>


<!-- simulation and planning -->
<group if="$(arg use_robot_sim)">
<!-- Spawn the full robot into Gazebo -->
<node name="spawn_robot" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model $(arg robot_name)" respawn="false" output="screen"/>

<!-- load Gazebo simulation environment -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<!-- when using the real/sim scenario in parallel, set "use_enabled_time" to false -->
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="true"/>
<arg name="debug" value="false"/>
</include>
</group>

<!-- load moveit configuration -->
<group if="$(arg load_moveit)">
<include file="$(find dobot_m1_moveit)/launch/move_group.launch">
<arg name="allow_trajectory_execution" value="true"/>
<arg name="fake_execution" value="false"/>
<arg name="info" value="true"/>
<arg name="debug" value="false"/>
</include>
</group>

<!-- controllers are launched always, since either real or simulated hardware will be present -->
<group ns="$(arg robot_name)">
<rosparam command="load" file="$(find dobot_m1_hw)/config/controllers.yaml"/>

<group if="$(arg use_robot_sim)">
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
</group>
<group unless="$(arg use_robot_sim)">
<include file="$(find dobot_m1_hw)/launch/dobot_m1_hw.launch">
<arg name="enabled" value="true"/>
<!-- to implement as param + other dobot settings <param name="deviceIP" value="192.168.1.192"/> -->
</include>
</group>

<!-- load the controllers in current namespace -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="joint_state_controller joint_trajectory_controller" />

</group>

</launch>
Loading

0 comments on commit b985625

Please sign in to comment.