Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 9b5b2b7

Browse files
committed
mra_ros_control respository is created
0 parents  commit 9b5b2b7

File tree

73 files changed

+5799
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5799
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The mra_ros_control respository
2+
**This repository is used to control real aubo's MRA(module robot amr) by ROS.**<br>
3+
1. The **mra_basic** package is the driver to commuicate with the real MRA hardware and provides the some related topic of the ros control.<br>
4+
2. The **mra_control** package is the abstraction of real MRA hardware.<br>
5+
3. The **mra_core_msgs** package is the communication messages between mra_control and mra_basic.<br>
6+
4. The **mra_joint_state_publisher** package is used to simulate MRA_API to send joint state and mra state<br>
7+
5. The **ros_control** stack :See [ros_control documentation](http://ros.org/wiki/ros_control) on ros.org<br>
8+
6. The **ros_controllers** stack is the implement of related ros controllers.<br>
9+
7. The **moveit_visual_tools** package the helper for displaying and debugging MoveIt! data in Rviz<br>

moveit_visual_tools

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit e1c17c76e681273017b7c966d5e39571124c2abf

mra_basic/CMakeLists.txt

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(mra_basic)
3+
4+
#### Now,FindMRA_API.cmake can automatically judge system digets by camke parameter "CMAKE_SIZEOF_VOID_P" ###
5+
#Set System Digits, default 32
6+
#You can lookup the parameter by runing "getconf LONG_BIT" in the terminal
7+
#set(LONG_BIT "32")
8+
9+
#support C++11
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
11+
12+
## Find catkin macros and libraries
13+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
14+
## is used, also find other catkin packages
15+
find_package(catkin REQUIRED COMPONENTS
16+
roscpp
17+
rospy
18+
std_msgs
19+
mra_core_msgs
20+
21+
#message_generation
22+
)
23+
24+
## System dependencies are found with CMake's conventions
25+
# find_package(Boost REQUIRED COMPONENTS system)
26+
27+
28+
## Uncomment this if the package has a setup.py. This macro ensures
29+
## modules and global scripts declared therein get installed
30+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
31+
# catkin_python_setup()
32+
33+
################################################
34+
## Declare ROS messages, services and actions ##
35+
################################################
36+
37+
## To declare and build messages, services or actions from within this
38+
## package, follow these steps:
39+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
40+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
41+
## * In the file package.xml:
42+
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
43+
## * If MSG_DEP_SET isn't empty the following dependencies might have been
44+
## pulled in transitively but can be declared for certainty nonetheless:
45+
## * add a build_depend tag for "message_generation"
46+
## * add a run_depend tag for "message_runtime"
47+
## * In this file (CMakeLists.txt):
48+
## * add "message_generation" and every package in MSG_DEP_SET to
49+
## find_package(catkin REQUIRED COMPONENTS ...)
50+
## * add "message_runtime" and every package in MSG_DEP_SET to
51+
## catkin_package(CATKIN_DEPENDS ...)
52+
## * uncomment the add_*_files sections below as needed
53+
## and list every .msg/.srv/.action file to be processed
54+
## * uncomment the generate_messages entry below
55+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
56+
57+
## Generate messages in the 'msg' folder
58+
#add_message_files(
59+
# FILES
60+
# Joint.msg
61+
#)
62+
63+
#generate_messages()
64+
65+
## Generate services in the 'srv' folder
66+
# add_service_files(
67+
# FILES
68+
# Service1.srv
69+
# Service2.srv
70+
# )
71+
72+
## Generate actions in the 'action' folder
73+
# add_action_files(
74+
# FILES
75+
# Action1.action
76+
# Action2.action
77+
# )
78+
79+
## Generate added messages and services with any dependencies listed here
80+
#generate_messages(
81+
# DEPENDENCIES
82+
# std_msgs
83+
#)
84+
85+
###################################
86+
## catkin specific configuration ##
87+
###################################
88+
## The catkin_package macro generates cmake config files for your package
89+
## Declare things to be passed to dependent projects
90+
## INCLUDE_DIRS: uncomment this if you package contains header files
91+
## LIBRARIES: libraries you create in this project that dependent projects also need
92+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
93+
## DEPENDS: system dependencies of this project that dependent projects also need
94+
catkin_package(
95+
INCLUDE_DIRS include
96+
# LIBRARIES
97+
CATKIN_DEPENDS roscpp rospy std_msgs mra_core_msgs #message_runtime
98+
# DEPENDS system_lib
99+
)
100+
101+
###########
102+
## Build ##
103+
###########
104+
105+
## Specify additional locations of header files
106+
## Your package locations should be listed before other locations
107+
# include_directories(include)
108+
include_directories(include ${catkin_INCLUDE_DIRS} )
109+
110+
## Declare a cpp library
111+
# add_library(our_ros
112+
# src/${PROJECT_NAME}/our_ros.cpp
113+
# )
114+
115+
## Declare a cpp executable
116+
# add_executable(our_ros_node src/our_ros_node.cpp)
117+
118+
## Add cmake target dependencies of the executable/library
119+
## as an example, message headers may need to be generated before nodes
120+
# add_dependencies(our_ros_node our_ros_generate_messages_cpp)
121+
122+
## Specify libraries to link a library or executable target against
123+
# target_link_libraries(our_ros_node
124+
# ${catkin_LIBRARIES}
125+
# )
126+
127+
#############
128+
## Install ##
129+
#############
130+
131+
# all install targets should use catkin DESTINATION variables
132+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
133+
134+
## Mark executable scripts (Python etc.) for installation
135+
## in contrast to setup.py, you can choose the destination
136+
# install(PROGRAMS
137+
# scripts/my_python_script
138+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
139+
# )
140+
141+
## Mark executables and/or libraries for installation
142+
# install(TARGETS our_ros our_ros_node
143+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
144+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
145+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
146+
# )
147+
148+
## Mark cpp header files for installation
149+
# install(DIRECTORY include/${PROJECT_NAME}/
150+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
151+
# FILES_MATCHING PATTERN "*.h"
152+
# PATTERN ".svn" EXCLUDE
153+
# )
154+
155+
## Mark other files for installation (e.g. launch and bag files, etc.)
156+
# install(FILES
157+
# # myfile1
158+
# # myfile2
159+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
160+
# )
161+
162+
#############
163+
## Testing ##
164+
#############
165+
166+
## Add gtest based cpp test target and link libraries
167+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_our_ros.cpp)
168+
# if(TARGET ${PROJECT_NAME}-test)
169+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
170+
# endif()
171+
172+
## Add folders to be run by python nosetests
173+
# catkin_add_nosetests(test)
174+
175+
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
176+
message(STATUS " CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}")
177+
178+
add_subdirectory(src/control_panel)
179+
add_subdirectory(src/joint_control)
180+
181+
182+

mra_basic/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# mra_basic package
2+
**This package is used to control real aubo's MRA(Module Robot Arm) by ROS**
3+
4+
There are two executable fiels: joint control and control_panel.
5+
6+
When you are using mra_ros_control package to control MRA7A, you need the first step: rosrun mra_basic joint_control.
7+
8+
***
9+
**Note:**
10+
1. In the include/mra_basic/config.h file, you can change some config.<br>
11+
such as:jointID, joint_names, topic_names, etc.<br>
12+
2. In the top CMakeList.txt file, you need to change the system parameter "LONG_BIT" according to your system. You can lookup the parameter by runing "getconf LONG_BIT" in the terminal<br>
13+
*set(LONG_BIT "32")* <br>
14+
***
15+
Here, We provides a simple test to control MRA7A's joint independently using a QT panel.<br>
16+
**Steps:**<br>
17+
1.roscore<br>
18+
2.rosrun mra_basic joint_control<br>
19+
3.rosrun mra_basic control_panel<br>
20+
***
21+
**Design ideas:**<br>
22+
joint_control: <br>
23+
It's node graph as follow: <br>
24+
<img src="./image/joint_control.png" width=400 height=100 /> <br>
25+
It subscribes the "/mra/joint_command" topic to contorl the MRA's joint position, velocity, or effort, and the "/mra/reset_MRA_API" topic to reinit MRA_API if the canbus interrupts. Besides, It publishes the joint_states and mra_state msgs at 100 hz frequency.
26+
27+
28+
29+
30+

mra_basic/cmake/FindMRA_API.cmake

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# - Try to find libMRA_API
2+
# Once done this will define
3+
#
4+
# libMRA_API_FOUND - system has libMRA_API
5+
# libMRA_API_INCLUDE_DIRS - the libMRA_API include directories
6+
# libMRA_API_LIBS - link these to use libMRA_API
7+
8+
find_path(libMRA_API_INCLUDE_DIR
9+
NAMES mra_api.h
10+
PATHS /usr/include/MRA_API
11+
/usr/local/include/MRA_API
12+
${PROJECT_SOURCE_DIR}/include/MRA_API
13+
$ENV{INCLUDE}
14+
)
15+
16+
17+
set(libMRA_API_INCLUDE_DIRS ${libMRA_API_INCLUDE_DIR})
18+
message(STATUS ${libMRA_API_INCLUDE_DIR})
19+
message(STATUS ${CMAKE_SYSTEM_PROCESSOR} "---" ${CMAKE_SIZEOF_VOID_P})
20+
#Methord 1 : Automatically judge system digets by camke parameter "CMAKE_SIZEOF_VOID_P"
21+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
22+
message(STATUS "System LONG_BIT is 64")
23+
find_library(libMRA_API_LIB
24+
NAMES CANAPI
25+
PATHS ${PROJECT_SOURCE_DIR}/lib/MRA_API64
26+
)
27+
else()
28+
message(STATUS "System LONG_BIT is 32")
29+
find_library(libMRA_API_LIB
30+
NAMES CANAPI
31+
PATHS ${PROJECT_SOURCE_DIR}/lib/MRA_API32
32+
)
33+
endif()
34+
35+
#Methord 2: user set the LONG_BIT parameter by hand in top CMakelist.txt
36+
#if(${LONG_BIT} STREQUAL "32")
37+
# message(STATUS "System LONG_BIT is setted to 32")
38+
# find_library(libMRA_API_LIB
39+
# NAMES CANAPI
40+
# PATHS ${PROJECT_SOURCE_DIR}/lib/MRA_API32
41+
# )
42+
#else()
43+
# message(STATUS "System LONG_BIT is setted to 64")
44+
# find_library(libMRA_API_LIB
45+
# NAMES CANAPI
46+
# PATHS ${PROJECT_SOURCE_DIR}/lib/MRA_API64
47+
# )
48+
#endif()
49+
50+
51+
set(libMRA_API_LIBS ${libMRA_API_LIB})
52+
53+
if(libMRA_API_INCLUDE_DIRS)
54+
message(STATUS "Found MRA_API include dir: ${libMRA_API_INCLUDE_DIRS}")
55+
else(libMRA_API_INCLUDE_DIRS)
56+
message(STATUS "Could NOT find MRA_API headers.")
57+
endif(libMRA_API_INCLUDE_DIRS)
58+
59+
if(libMRA_API_LIBS)
60+
message(STATUS "Found MRA_API library: ${libMRA_API_LIBS}")
61+
else(libMRA_API_LIBS)
62+
message(STATUS "Could NOT find libMRA_API library.")
63+
endif(libMRA_API_LIBS)
64+
65+
if(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
66+
set(libMRA_API_FOUND TRUE)
67+
else(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
68+
set(libMRA_API_FOUND FALSE)
69+
message(FATAL_ERROR "Could not find MRA_API.")
70+
endif(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)

mra_basic/cmake/FindMRA_API.cmake~

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# - Try to find libMRA_API
2+
# Once done this will define
3+
#
4+
# libMRA_API_FOUND - system has libMRA_API
5+
# libMRA_API_INCLUDE_DIRS - the libMRA_API include directories
6+
# libMRA_API_LIBS - link these to use libMRA_API
7+
8+
find_path(libMRA_API_INCLUDE_DIR
9+
NAMES driver.h
10+
PATHS /usr/include/MRA_API
11+
/usr/local/include/MRA_API
12+
${PROJECT_SOURCE_DIR}/include/MRA_API
13+
$ENV{INCLUDE}
14+
)
15+
16+
17+
set(libMRA_API_INCLUDE_DIRS ${libMRA_API_INCLUDE_DIR})
18+
19+
find_library(libMRA_API_LIB
20+
NAMES CANAPI
21+
PATHS /usr/lib/MRA_API
22+
/usr/local/lib/MRA_API
23+
${PROJECT_SOURCE_DIR}/lib/MRA_API
24+
)
25+
26+
set(libMRA_API_LIBS ${libMRA_API_LIB})
27+
28+
if(libMRA_API_INCLUDE_DIRS)
29+
message(STATUS "Found MRA_API include dir: ${libMRA_API_INCLUDE_DIRS}")
30+
else(libMRA_API_INCLUDE_DIRS)
31+
message(STATUS "Could NOT find MRA_API headers.")
32+
endif(libMRA_API_INCLUDE_DIRS)
33+
34+
if(libMRA_API_LIBS)
35+
message(STATUS "Found MRA_API library: ${libMRA_API_LIBS}")
36+
else(libMRA_API_LIBS)
37+
message(STATUS "Could NOT find libMRA_API library.")
38+
endif(libMRA_API_LIBS)
39+
40+
if(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
41+
set(libMRA_API_FOUND TRUE)
42+
else(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
43+
set(libMRA_API_FOUND FALSE)
44+
message(FATAL_ERROR "Could not find MRA_API.")
45+
endif(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)

mra_basic/cmake/FindOUR_API.cmake~

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# - Try to find libMRA_API
2+
# Once done this will define
3+
#
4+
# libMRA_API_FOUND - system has libMRA_API
5+
# libMRA_API_INCLUDE_DIRS - the libMRA_API include directories
6+
# libMRA_API_LIBS - link these to use libMRA_API
7+
8+
find_path(libMRA_API_INCLUDE_DIR
9+
NAMES driver.h
10+
PATHS /usr/include/MRA_API
11+
/usr/local/include/MRA_API
12+
${PROJECT_SOURCE_DIR}/include/MRA_API
13+
$ENV{INCLUDE}
14+
)
15+
16+
17+
set(libMRA_API_INCLUDE_DIRS ${libMRA_API_INCLUDE_DIR})
18+
19+
find_library(libMRA_API_LIB
20+
NAMES CANAPI
21+
PATHS /usr/lib/MRA_API
22+
/usr/local/lib/MRA_API
23+
${PROJECT_SOURCE_DIR}/lib/MRA_API
24+
)
25+
26+
set(libMRA_API_LIBS ${libMRA_API_LIB})
27+
28+
if(libMRA_API_INCLUDE_DIRS)
29+
message(STATUS "Found MRA_API include dir: ${libMRA_API_INCLUDE_DIRS}")
30+
else(libMRA_API_INCLUDE_DIRS)
31+
message(STATUS "Could NOT find MRA_API headers.")
32+
endif(libMRA_API_INCLUDE_DIRS)
33+
34+
if(libMRA_API_LIBS)
35+
message(STATUS "Found MRA_API library: ${libMRA_API_LIBS}")
36+
else(libMRA_API_LIBS)
37+
message(STATUS "Could NOT find libMRA_API library.")
38+
endif(libMRA_API_LIBS)
39+
40+
if(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
41+
set(libMRA_API_FOUND TRUE)
42+
else(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)
43+
set(libMRA_API_FOUND FALSE)
44+
message(FATAL_ERROR "Could not find MRA_API.")
45+
endif(libMRA_API_INCLUDE_DIRS AND libMRA_API_LIBS)

0 commit comments

Comments
 (0)