Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users/ajyanand/humanoidcontrol #22

Merged
merged 26 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "DynamixelSDK"]
path = DynamixelSDK
url = [email protected]:ROBOTIS-GIT/DynamixelSDK.git
20 changes: 18 additions & 2 deletions Contributors/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
## File system format:

Each of the subsystems has its own subdirectory, please name these folders in snake case.
All the files in the subdirectories are to be named in camel case.
Each of the subsystems has its own subdirectory, please name these folders in snake_case.
All the files in the subdirectories are to be named in lowerCamelCase.
ROS message and service definitions are to be named in UpperCamelCase.


## Contributing:
No one is allowed to push to the master branch. All the changes must be made in a separate branch and then a pull request must be created to the master branch. The pull request will be reviewed by the maintainers and then merged to the master branch.

Create a branch with the name of the subsystem you are working on, if you are the only contributor working on that issue, use the format users/<your_username>/<subsystem_name>. If you are working on an issue with multiple contributors, use the format issues/<issue_number>/<subsystem_name>. If you are working on a subsystem that is not an issue, use the format features/<subsystem_name>.

When you are done with your work, create a pull request to the master branch. If you are working on an issue, please mention the issue number in the pull request description. If you are working on a feature, please mention the feature name in the pull request description. If you are working on a subsystem that is not an issue, please mention the subsystem name in the pull request description. Before merging, make sure that the current branch is up to date with the master branch.

## Code style:
<In Progress>
To maintain a consistent code style, we use linters. The linters are configured to run automatically on every pull request. If the linters fail, the PR will not be allowed to merge. If you want to run the linters manually, run the following command in the root directory of the project:
<To Be Added>
Please follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for python code.
Please follow for the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) for C++ code.
1 change: 1 addition & 0 deletions DynamixelSDK
Submodule DynamixelSDK added at 3450c7
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Flo-System-2
This is the master code repository for the second iteration of the Flo system.
It contains code used for the control of the humanoid robot, the control of the mobile telepresence platform and the autonomous navigation stack.

It contains repositories for the following components:
1. Control of the joints of second version of the flo humanoid
2. Control of the ohmni telepresence base
3. Camera and sensor data collection
4. Central systems to coordinate the above components
## License:

MIT License.
Expand All @@ -19,6 +13,22 @@ The above copyright notice and this permission notice shall be included in all c

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Overview:

This repository contains the following components:

1. Control system of the humanoid robot (Dynamixel motors: 2 XL430-W250-T, 1 XC430-W240-T, 1 XM430-W350-T and 1 RX-64 motor per arm)
2. Control system of the mobile telepresence platform (Ohmni telepresence platform)
3. RGB-D cameras (2 Luxonis Oak-D cameras)
4. 2 dimensional lidar sensor (rp lidar a1)
5. object localization system (April tag 3)
6. Centeral user interface (web interface?)

The system is designed to be modular and each component can be run independently, ROS is used as the communication framework between the components.

Each component will be running as a seperate process in a docker container and interfacing with the ros master remotely.


## Connecting to the Ohmni telepresence robot and running docker
1. Clone this repository using git clone https://github.com/Rehab-Robotics-Lab/Flo-System-2.git
2. Download the private ssh key from penn box https://upenn.app.box.com/folder/206840565719; contact @anht-nguyen for access if necessary.
Expand Down
9 changes: 9 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
flo_humanoid:
build: /flo_humanoid
ports:
ohmni_base:
build: /ohmni_base
ports:


46 changes: 19 additions & 27 deletions flo_humanoid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ find_package(catkin REQUIRED
# Declare ROS messages, services and actions
################################################################################
## Generate messages in the 'msg' folder
add_message_files(
FILES
SetPosition.msg
SyncSetPosition.msg
BulkSetItem.msg
)
# add_message_files(
# FILES
# SetPosition.msg
# SyncSetPosition.msg
# BulkSetItem.msg
# )

## Generate services in the 'srv' folder
add_service_files(
FILES
GetPosition.srv
SyncGetPosition.srv
BulkGetItem.srv
)
# add_service_files(
# FILES
# GetPosition.srv
# SyncGetPosition.srv
# BulkGetItem.srv
# )

## Generate added messages and services with any dependencies listed here
generate_messages(
Expand Down Expand Up @@ -63,27 +63,19 @@ include_directories(
${catkin_INCLUDE_DIRS}
)

add_executable(read_write_node src/read_write_node.cpp)
add_dependencies(read_write_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(read_write_node ${catkin_LIBRARIES})

add_executable(sync_read_write_node src/sync_read_write_node.cpp)
add_dependencies(sync_read_write_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(sync_read_write_node ${catkin_LIBRARIES})

add_executable(bulk_read_write_node src/bulk_read_write_node.cpp)
add_dependencies(bulk_read_write_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(bulk_read_write_node ${catkin_LIBRARIES})
add_executable(readWriteArm src/readWriteArm.cpp)
add_dependencies(readWriteArm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(readWriteArm ${catkin_LIBRARIES})

add_executable(indirect_address_node src/indirect_address_node.cpp)
add_dependencies(indirect_address_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(indirect_address_node ${catkin_LIBRARIES})
add_executable(readWriteJoint src/readWriteJoint.cpp)
add_dependencies(readWriteJoint ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(readWriteJoint ${catkin_LIBRARIES})

################################################################################
# Install
################################################################################
## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
install(TARGETS read_write_node sync_read_write_node bulk_read_write_node indirect_address_node
install(TARGETS readWriteArm readWriteJoint
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
51 changes: 22 additions & 29 deletions flo_humanoid/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
#base image from ohmnilabsvn/ohmni_ros:ohmni_ros_tbcontrol_0.0.13, preinstalled with ros-melodic + tb control ros packages
FROM ohmnilabsvn/ohmni_ros:ohmni_ros_tbcontrol_0.0.13
FROM ros:melodic-robot-bionic
#make super user
RUN su
ARG ROS_DISTRO=melodic
ENV ROS_DISTRO="$ROS_DISTRO"
#install essential tools
RUN apt-get update -y && sudo apt-get -y install \
RUN apt-get update -y && apt-get install -y \
neovim \
tmux \
git
# clear cache
RUN apt-get clean
#switch to ohmnidev directory, used for placing code.
WORKDIR /home/ohmnidev
RUN git clone https://github.com/Rehab-Robotics-Lab/FloSystemV2.git
WORKDIR /home/ohmnidev/FloSystemV2
RUN git pull
WORKDIR /home/ohmnidev
RUN mkdir -p catkin_ws
WORKDIR /home/ohmnidev/catkin_ws
ARG ROS_DISTRO=melodic
ENV ROS_DISTRO="$ROS_DISTRO"
RUN apt-get update && apt-get install -y ros-$ROS_DISTRO-catkin \
#install usb utilities to get info on connected devices - might not be as useful. comment next line if not needed.
#usbutils\
#The following 2 lines download libraries for control of arduino via ros
#ros-$ROS_DISTRO-rosserial \
#ros-$ROS_DISTRO-rosserial-arduino\
#THE following line downloads the dynamixel sdk for ros.
ros-melodic-dynamixel-sdk\
#The following line downloads the dynamixel sdk examples for ros.
ros-melodic-dynamixel-sdk-examples

git \
ros-$ROS_DISTRO-catkin \
ros-$ROS_DISTRO-dynamixel-sdk\
ros-$ROS_DISTRO-dynamixel-sdk-examples

#Lidar libraries
#RUN git clone https://github.com/Slamtec/rplidar_ros.git

#Build the catkin_ws
#RUN catkin_make -j1 -l1
# clear cache
RUN apt-get clean

RUN mkdir -p home/git
WORKDIR /home/git
RUN git clone https://github.com/Rehab-Robotics-Lab/FloSystemV2.git
WORKDIR /home/git
RUN mkdir -p catkin_ws
RUN cp -r /FloSystemV2/flo_humanoid /catkin_ws/src catkin_ws/flo_humanoid
RUN cp -r /FloSystemV2/flo_humanoid_defs /catkin_ws/src catkin_ws/flo_humanoid_defs
WORKDIR /home/git/catkin_ws
RUN catkin_make -j1 -l1

ENTRYPOINT ["./ros_entrypoint.sh"]
CMD ["bash"]

#add as neccessary.



Expand Down
22 changes: 12 additions & 10 deletions flo_humanoid/config/joints
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#fill this table with the joints you want to control in the humanoid robot and their configurations.
<<<<<<< HEAD
#address refers to the motor address set in the dynamixel wizard
address name neutral min max inversion
#eg:
# 1 left_shoulder_flexionextension 765 10 500 1
=======
(dynamixel motor address and joint name for each motor)
>>>>>>> 6a1935e1108d90aad7556325ae2f6b80f855f72c
address name neutral min max inversion
address name type neutral min max inversion
#eg:
# 1 left_shoulder_flexionextension 765 10 500 1

# 1 left_shoulder_flexionextension <motortype> 765 10 500 1
10 placeholder XC-430-W240-T 0 0 0 0
11 placeholder XL-430-W250-T 0 0 0 0
12 placeholder XL-430-W250-T 0 0 0 0
13 placeholder XM-430-W350-T 0 0 0 0
14 placeholder MX-64 0 0 0 0
20 placeholder XC-430-W240-T 0 0 0 0
21 placeholder XL-430-W250-T 0 0 0 0
22 placeholder XL-430-W250-T 0 0 0 0
23 placeholder XM-430-W350-T 0 0 0 0
24 placeholder MX-64 0 0 0 0
19 changes: 19 additions & 0 deletions flo_humanoid/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package format="2">
<name>flo_humanoid_defs</name>
<version>0.0.0</version>
<description>Contains code to pass commands to and read position information from the dynamixel motors used in the flo v2 humanoid</description>
<maintainer email="[email protected]">Ajay Anand</maintainer>
<license>proprietery</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_export_depend>std_msgs</build_export_depend>
<build_export_depend>actionlib_msgs</build_export_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>flo_humanoid_defs</exec_depend>
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
Loading