δΈζζζ‘£ | English Documentation
Control or simulate myCobot series robots in ROS.
Notes:
-
Make sure that
Atom
is flashed into the top Atom andTransponder
orminirobot
is flashed into the base Basic .The tool download address: https://github.com/elephantrobotics/myCobot/tree/main/Software -
Supported ROS versions:
- Ubuntu 16.04 / ROS Kinetic
- Ubuntu 18.04 / ROS Melodic
- Ubuntu 20.04 / ROS Noetic
-
The urdf model of a single gripper in this article is applicable to all machines that support this accessory.
There are two ways to run this project. The first is by running the project in a container, and this requires installing docker and installing docker-compose. The benefit of running in the container is that you can run the project in any version of linux, as long as your kernel is new enough.
Once docker is installed, run the following command, and the project should show up.
ROS Noetic:
docker-compose build ros-noetic && xhost +local:root && docker-compose up ros-noetic
ROS Melodic:
docker-compose build ros && xhost +local:root && docker-compose up ros
ROS Noetic:
docker-compose build nvidia-ros-noetic && xhost +local:root && docker-compose up nvidia-ros-noetic
ROS Melodic:
docker-compose build nvidia-ros && xhost +local:root && docker-compose up nvidia-ros
This command does three things:
-
docker-compose build ros
This builds the project in a container. That means nothing is installed on your host machine! The first time this runs, this command will take a long while. After running it once, caching will allow this command to run quickly.
-
xhost +local:root
This command gives X the ability to display GUI's from within the docker container
-
docker-compose up ros
This runs the image specified in the
docker-compose.yml
, which by default runs the commandroslaunch mycobot_320 mycobot_320_slider.launch
within the container.
To run other tutorials, set the LAUNCH_TARGET environment variable. For example, to the run the MoveIt tutorial run:
export LAUNCH_TARGET=mycobot_320_moveit mycobot320_moveit.launch
docker-compose up ros
For using this package, the Python api library should be installed first.
pip install pymycobot --user
Install ros package in your src folder of your Catkin workspace.
$ cd ~/catkin_ws/src
$ git clone --depth 1 https://github.com/elephantrobotics/mycobot_ros.git
$ cd ~/catkin_ws
$ catkin_make
$ source ~/catkin_ws/devel/setup.bash
$ sudo echo 'source ~/catkin_ws/devel/setup.bash' >> ~/.bashrc
cd ~/catkin_ws/src/mycobot_ros
python test.py
There is documentation in the ElephantRobotics Docs. Please check the ROS chapter.
Contributions are always welcome!
See CONTRIBUTING.md for ways to get started.
Please adhere to this project's code of conduct.
mycobot 280 m5 camera flange & pump
mycobot 280 pi camera flange & pump
mycobot 280 JetsonNano Adaptive gripper
mycobot 280 JetsonNano Parallel gripper
mycobot 320 m5 2022 force control gripper
mycobot 320 pi 2022 force control gripper
This urdf model is applicable to all machines that support this accessory
mycobot Pro Adaptive gripper - old version
mycobot Pro Adaptive gripper (new version - Added more details)
- Slider Control The control of the robot arm model's pose in Gazebo through the sliders of joint_state_publisher_gui has now been achieved. Moreover, the pose of the robot arm model in Gazebo and the real robot arm can be controlled simultaneously via the sliders. After confirming that the real robot arm is connected to the computer, check the port to which the robot arm is connected:
ls /dev/tty*
/dev/ttyACM0 or /dev/ttyUSB0
The following output results are obtained:
/dev/tty /dev/tty26 /dev/tty44 /dev/tty62 /dev/ttyS20
/dev/tty0 /dev/tty27 /dev/tty45 /dev/tty63 /dev/ttyS21
/dev/tty1 /dev/tty28 /dev/tty46 /dev/tty7 /dev/ttyS22
/dev/tty10 /dev/tty29 /dev/tty47 /dev/tty8 /dev/ttyS23
/dev/tty11 /dev/tty3 /dev/tty48 /dev/tty9 /dev/ttyS24
/dev/tty12 /dev/tty30 /dev/tty49 /dev/ttyACM0 (/dev/ttyUSB0)
/dev/tty13 /dev/tty31 /dev/tty5 /dev/ttyprintk /dev/ttyS26
/dev/tty14 /dev/tty32 /dev/tty50 /dev/ttyS0 /dev/ttyS27
/dev/tty15 /dev/tty33 /dev/tty51 /dev/ttyS1 /dev/ttyS28
/dev/tty16 /dev/tty34 /dev/tty52 /dev/ttyS10 /dev/ttyS29
/dev/tty17 /dev/tty35 /dev/tty53 /dev/ttyS11 /dev/ttyS3
/dev/tty18 /dev/tty36 /dev/tty54 /dev/ttyS12 /dev/ttyS30
/dev/tty19 /dev/tty37 /dev/tty55 /dev/ttyS13 /dev/ttyS31
/dev/tty2 /dev/tty38 /dev/tty56 /dev/ttyS14 /dev/ttyS4
/dev/tty20 /dev/tty39 /dev/tty57 /dev/ttyS15 /dev/ttyS5
/dev/tty21 /dev/tty4 /dev/tty58 /dev/ttyS16 /dev/ttyS6
/dev/tty22 /dev/tty40 /dev/tty59 /dev/ttyS17 /dev/ttyS7
/dev/tty23 /dev/tty41 /dev/tty6 /dev/ttyS18 /dev/ttyS8
/dev/tty24 /dev/tty42 /dev/tty60 /dev/ttyS19 /dev/ttyS9
/dev/tty25 /dev/tty43 /dev/tty61 /dev/ttyS2
Open communication and Chmod
sudo chmod -R 777 /dev/ttyACM0 or sudo chmod -r 777 /dev/ttyUSB0
sudo chmod -R 777 280m5_gripper_gazebo/mycobot_280m5_gazebo_gripper/scripts/follow_display_gazebo.py
sudo chmod -R 777 280m5_gripper_gazebo/mycobot_280m5_gazebo_gripper/scripts/slider_control_gazebo.py
sudo chmod -R 777 280m5_gripper_gazebo/mycobot_280m5_gazebo_gripper/scripts/teleop_keyboard_gazebo.py
roscore
After confirming the port, open a terminal and enter the following command. Note that you should replace "port" with the value you found in the previous step.
source devel/setup.bash
roslaunch mycobot_280m5_gazebo_gripper slider.launch _port:=/dev/ttyACM0 _baud:=115200
Then open another terminal and enter the following command:
source devel/setup.bash
rosrun mycobot_280m5_gazebo_gripper slider_control_gazebo.py _port:=/dev/ttyACM0 _baud:=115200
Also remember to modify the port number to the one queried in the previous step. If the operation is successful, you will see the following terminal prompt:
('/dev/ttyACM0', 115200)
spin ...
At this point, you can control the poses of both the mechanical arm model in Gazebo or the real mechanical arm simultaneously by manipulating the sliders in the joint_state_publisher_gui.
- Gazebo Model Following The following command can be used to make the model in Gazebo change its pose in accordance with the movement of the actual robotic arm. First, run the launch file:
source devel/setup.bash
roslaunch mycobot_280m5_gazebo_gripper follower.launch _port:=/dev/ttyACM0
If the program runs successfully, the Gazebo interface will successfully load the robotic arm model, and all joints of the robotic arm model will be in the original pose, that is, [0, 0, 0, 0, 0, 0]. After that, we open the second terminal and run:
source devel/setup.bash
rosrun mycobot_280m5_gazebo_gripper follow_display_gazebo.py _port:=/dev/ttyACM0 _baud:=115200
Now when we control the pose of the actual robotic arm, we can see that the robotic arm in Gazebo will also move to the same pose together.
- Keyboard Control We can also use keyboard input to simultaneously control the pose of the robotic arm model in Gazebo and the actual robotic arm. First, open a terminal and enter:
source devel/setup.bash
roslaunch mycobot_280m5_gazebo_gripper teleop_keyboard.launch _port:=/dev/ttyACM0 _baud:=115200
As in the previous part, we will see the robotic arm model loaded into Gazebo, and all joints are at their initial poses. Then we open another terminal and enter:
source devel/setup.bash
rosrun mycobot_280m5_gazebo_gripper teleop_keyboard_gazebo.py _port:=/dev/ttyACM0 _baud:=115200
If the operation is successful, we will see the following output information in the terminal:
Mycobot_280_m5_gripper Teleop Keyboard Controller
---------------------------
Movimg options (control the angle of each joint):
w: joint2_to_joint1++ s: joint2_to_joint1--
e: joint3_to_joint2++ d: joint3_to_joint2--
r: joint4_to_joint3++ f: joint4_to_joint3--
t: joint5_to_joint4++ g: joint5_to_joint4--
y: joint6_to_joint5++ h: joint6_to_joint5--
u: joint6output_to_joint6++ j: joint6output_to_joint6--
o:open gripper p:close gripper
Other:
1 - Go to home pose
q - Quit
You can find out which interfaces pymycobot provides in README.md
.
Note: Version v3.6.0 differentiates interfaces by model. Starting from this version, the MyCobot class will no longer be maintained. For new usage, please refer to the document:
MyCobot 280 m5 gazeboδΈζζδ½
Thanks goes to these people (Emoji Key):
This project follows the all-contributors specification. Contributions of any kind are welcome!
Licensed under standard three-clause BSD license (same as ROS Core), Copyright 2020-2023 Elephant Robotics. Copy of the license.