Skip to content

Commit

Permalink
Merge pull request #129 from YWpepper/demo_gazebo
Browse files Browse the repository at this point in the history
Demo gazebo
  • Loading branch information
anla-xu authored Apr 28, 2024
2 parents ff3a4a9 + 142a096 commit 36adf30
Show file tree
Hide file tree
Showing 537 changed files with 6,430 additions and 18,156 deletions.
5 changes: 5 additions & 0 deletions Mercury/mercury_a1_moveit/config/mercury_a1.urdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" ?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="firefighter">
<xacro:property name="width" value=".2" />
<link name="world"/>
<joint name="fixed" type="fixed">
<parent link="world"/>
<child link="base"/>
</joint>
<link name="base">
<visual>
<geometry>
Expand Down
39 changes: 39 additions & 0 deletions Mercury/mercury_a1_moveit/document/交接文档-wenY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
交接文档的link:

https://github.com/YWpepper/mycobot_ros/tree/demo_gazebo/Mercury/mercury_a1_moveit/document

目前电脑中主要有两个环境,其中ubuntu1804是18的环境,其中ubuntu64位是20.04的环境,其中目前只在1804环境下运行gazebo和ros,,密码都为Elephant

![img](https://virginia-pepper.oss-cn-guangzhou.aliyuncs.com/img/blog/202404281510050.jpg)



为了实现固定操作,此处修改代码用于固定base世界坐标系的标签

![img](https://virginia-pepper.oss-cn-guangzhou.aliyuncs.com/img/blog/202404281510071.jpg)



项目参考gitbook链接:

[https://docs.elephantrobotics.com/docs/gitbook/12-ApplicationBaseROS/12.2-ROS2/12.2.1-ROS2%E7%9A%84%E5%AE%89%E8%A3%85.html](https://docs.elephantrobotics.com/docs/gitbook/12-ApplicationBaseROS/12.2-ROS2/12.2.1-ROS2的安装.html)



项目运行的方式:

roslaunch mercury_a1_moveit demo_gazebo.launch

其中demo.launch文件是ros+rviz的仿真

其中gazebo.launch文件是gazebo的仿真文件

其中demo_gazebo.launch文件是实现两个同步仿真

![img](https://virginia-pepper.oss-cn-guangzhou.aliyuncs.com/img/blog/202404281510121.jpg)

操作过程:

选择目标位置 + plan ,我们在rviz中看见机器完成动作组的规划后,可以使用execute命令发送动作组给到gazebo进行仿真,便完成了操作。

![img](https://virginia-pepper.oss-cn-guangzhou.aliyuncs.com/img/blog/202404281510124.jpg)
106 changes: 106 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,112 @@ Please adhere to this project's [code of conduct](CODE_OF_CONDUCT.md).

![Demo](./demo_img/320_moveit.png)

## URDF Model Graph

[mycobot 280 m5](./mycobot_description/urdf/mycobot_280_m5/mycobot_280_m5.urdf)

![280 m5](./demo_img/280m5/280_m5.png)

[mycobot 280 m5 gripper](./mycobot_description/urdf/mycobot_280_m5/mycobot_280m5_with_gripper_parallel.urdf)

![280 m5 gripper](./demo_img/280m5/280_m5_gripper.png)

[mycobot 280 m5 pump](./mycobot_description/urdf/mycobot_280_m5/mycobot_280m5_with_pump.urdf)

![280 m5 pump](./demo_img/280m5/280_m5_pump.png)

[mycobot 280 m5 camera flange](./mycobot_description/urdf/mycobot_280_m5/mycobot_280m5_with_camera_flange.urdf)

![280 m5 camera flange](./demo_img/280m5/280_m5_camera_flange.png)

[mycobot 280 m5 camera flange & pump](./mycobot_description/urdf/mycobot_280_m5/mycobot_280m5_with_camera_flange_pump.urdf)

![280 m5 camera flange & pump](./demo_img/280m5/280_m5_camera_flange_pump.png)

[mycobot 280 pi](./mycobot_description/urdf/mycobot_280_pi/mycobot_280_pi.urdf)

![280 pi](./demo_img/280pi/280_pi.png)

[mycobot 280 pi pump](./mycobot_description/urdf/mycobot_280_pi/mycobot_280pi_with_pump.urdf)

![280 pi pump](./demo_img/280pi/280_pi_pump.png)

[mycobot 280 pi camera flange](./mycobot_description/urdf/mycobot_280_pi/mycobot_280pi_with_camera_flange.urdf)

![280 pi camera flange](./demo_img/280pi/280_pi_camera_flange.png)

[mycobot 280 pi camera flange & pump](./mycobot_description/urdf/mycobot_280_pi/mycobot_280pi_with_camera_flange_pump.urdf)

![280 pi camera flange pump](./demo_img/280pi/280_pi_camera_flange_pump.png)

[mycobot 280 JetsonNano](./mycobot_description/urdf/mycobot_280_jn/mycobot_280_jn.urdf)

![280 jn](./demo_img/280jn/280jn.png)

[mycobot 280 Arduino](./mycobot_description/urdf/mycobot_280_arduino/mycobot_280_arduino.urdf)

![280 ar](./demo_img/280arduino/280_arduino.png)

[mechArm 270 m5](./mycobot_description/urdf/mecharm_270_m5/mecharm_270_m5.urdf)

![270 m5](./demo_img/270m5/270m5.png)

[mechArm 270 pi](./mycobot_description/urdf/mecharm_270_pi/mecharm_270_pi.urdf)

![270 pi](./demo_img/270pi/270pi.png)

[myPalletizer 260 m5](./mycobot_description/urdf/mypalletizer_260_m5/mypalletizer_260_m5.urdf)

![260 m5](./demo_img/260m5/260m5.png)

[myPalletizer 260 pi](./mycobot_description/urdf/mypalletizer_260_pi/mypalletizer_260_pi.urdf)

![260 pi](./demo_img/260pi/260pi.png)

[mycobot 320 m5 2020](./mycobot_description/urdf/mycobot_320_m5_2020/mycobot_pro_320_m5_2020.urdf)

![320 m5 2020](./demo_img/320m5_2020/320m5_2020.png)

[mycobot 320 m5 2022](./mycobot_description/urdf/mycobot_320_m5_2022/new_mycobot_pro_320_m5_2022.urdf)

![320 m5 2022](./demo_img/320m5_2022/320m5_2022.png)

[mycobot 320 m5 2022 gripper](./mycobot_description/urdf/mycobot_320_m5_2022/new_mycobot_pro_320_m5_2022_gripper.urdf)

![320 m5 2022 gripper](./demo_img/320m5_2022/320m5_gripper_2022.png)

[mycobot 320 pi 2022](./mycobot_description/urdf/mycobot_320_pi_2022/new_mycobot_pro_320_pi_2022.urdf)

![320 pi 2022](./demo_img/320pi_2022/320pi_2022.png)

[ultraArm P340](./mycobot_description/urdf/ultraArm_p340/ultraArm_p340.urdf)

![p340](./demo_img/ultraArm_p340/ultraArmp340.png)

[mycobot 280 pi aikit](./mycobot_description/urdf/mycobot_280_pi/mycobot_280pi_with_vision_v2.urdf)

![aikit 280pi](./demo_img/aikit/aikit_280pi.png)

[mycobot 320 pi aikit](./mycobot_description/urdf/mycobot_320_pi_2022/new_mycobot_vision_v2_2022.urdf)

![aikit 320pi](./demo_img/aikit/aikit_320pi.png)

[mybuddy](./mycobot_description/urdf/mybuddy/mybuddy.urdf)

![mybuddy](./demo_img/mybuddy/mybuddy.png)

[mycobot pro 600](./mycobot_description/urdf/mycobot_pro_600/mycobot_pro_600.urdf)

![pro600](./demo_img/pro600/pro600.png)

[myArm 300 Pi](./mycobot_description/urdf/myarm_300_pi/myarm_300_pi.urdf)

![myarm](./demo_img/myarm300/myarm300.png)

[mycobot pro 630](./mycobot_description/urdf/mycobot_pro_630/mycobot_pro_630.urdf)

![pro630](./demo_img/pro630/pro630.png)

## Contributors

Thanks goes to these people ([Emoji Key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
Binary file added demo_img/260m5/260m5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/260pi/260pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/270m5/270m5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/270pi/270pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280arduino/280_arduino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280jn/280jn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280m5/280_m5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280m5/280_m5_camera_flange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280m5/280_m5_camera_flange_pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280m5/280_m5_gripper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280m5/280_m5_pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280pi/280_pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280pi/280_pi_camera_flange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280pi/280_pi_camera_flange_pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/280pi/280_pi_pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/320m5_2020/320m5_2020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/320m5_2022/320m5_2022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/320m5_2022/320m5_gripper_2022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/320pi_2022/320pi_2022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/aikit/aikit_280pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/aikit/aikit_320pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/myarm300/myarm300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/mybuddy/mybuddy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/pro600/pro600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/pro630/pro630.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo_img/ultraArm_p340/ultraArmp340.png
2 changes: 1 addition & 1 deletion mecharm/mecharm/launch/follow.launch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<!-- Load file model .加载文件模型-->
<arg name="model" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="model" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>
<arg name="rvizconfig" default="$(find mecharm)/config/mecharm.rviz" />

<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm/launch/simple_gui.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="port" default="/dev/ttyUSB0" />
<arg name="baud" default="115200" />
<!-- Load file model ,加载文件模型-->
<arg name="model" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="model" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>
<arg name="rvizconfig" default="$(find mecharm)/config/mecharm.rviz" />
<arg name="gui" default="false" />

Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm/launch/slider_control.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="baud" default="1000000" /> -->

<!-- Load file model ,加载文件模型-->
<arg name="model" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="model" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>
<arg name="rvizconfig" default="$(find mecharm)/config/mecharm.rviz" />
<arg name="gui" default="true" />

Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm/launch/teleop_keyboard.launch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Load file model ,加载文件模型-->
<!-- <arg name="model" default="$(find mycobot_description)/urdf/260_urdf/mycobot_urdf.urdf"/>
<arg name="rvizconfig" default="$(find mycobot_280)/config/mycobot.rviz" /> -->
<arg name="model" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="model" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>
<arg name="rvizconfig" default="$(find mecharm)/config/mecharm.rviz" />
<arg name="gui" default="false" />

Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm/launch/test.launch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<!-- Load file model,加载文件模型 -->
<arg name="model" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="model" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>
<arg name="rvizconfig" default="$(find mecharm)/config/mecharm.rviz" />

<arg name="gui" default="true" />
Expand Down
21 changes: 12 additions & 9 deletions mecharm/mecharm/scripts/slider_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python
# -*- coding:utf-8 -*-

"""[summary]
Expand All @@ -9,7 +9,8 @@
port: serial prot string. Defaults is '/dev/ttyUSB0'
baud: serial prot baudrate. Defaults is 115200.
"""

import math
import time
import rospy
from sensor_msgs.msg import JointState

Expand All @@ -22,25 +23,27 @@

def callback(data):
# rospy.loginfo(rospy.get_caller_id() + "%s", data.position)
print(data.position)
data_list = []
for index, value in enumerate(data.position):
data_list.append(value)

# print(data_list)
mc.send_radians(data_list, 80)
# time.sleep(0.5)
radians_to_angles = round(math.degrees(value), 2)
data_list.append(radians_to_angles)
rospy.loginfo(rospy.get_caller_id() + "%s", data_list)
mc.send_angles(data_list, 25)


def listener():
global mc
rospy.init_node("control_slider", anonymous=True)

rospy.Subscriber("joint_states", JointState, callback)
port = rospy.get_param("~port", "/dev/ttyUSB0") # Select connected device. 选择连接设备
port = rospy.get_param("~port", "/dev/ttyUSB0")
baud = rospy.get_param("~baud", 115200)
print(port, baud)
mc = MyCobot(port, baud)
time.sleep(0.05)
mc.set_free_mode(1)
time.sleep(0.05)

# spin() simply keeps python from exiting until this node is stopped
# spin() 只是阻止python退出,直到该节点停止
Expand Down
1 change: 0 additions & 1 deletion mecharm/mecharm_moveit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ catkin_package()
## in contrast to setup.py, you can choose the destination
catkin_install_python(PROGRAMS
scripts/sync_plan.py
scripts/path_planning_and_obstacle_avoidance_demo.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm_moveit/launch/demo_gazebo.launch
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<arg name="gazebo_gui" default="true"/>
<arg name="paused" default="false"/>
<!-- By default, use the urdf location provided from the package -->
<arg name="urdf_path" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="urdf_path" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>

<!-- launch the gazebo simulator and spawn the robot -->
<include file="$(find mecharm_moveit)/launch/gazebo.launch" >
Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm_moveit/launch/gazebo.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch>
<arg name="paused" default="false"/>
<arg name="gazebo_gui" default="true"/>
<arg name="urdf_path" default="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<arg name="urdf_path" default="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>

<!-- startup simulated world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
Expand Down
4 changes: 2 additions & 2 deletions mecharm/mecharm_moveit/launch/moveit.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Visualization Manager:
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Acceleration_Scaling_Factor: 1
- Acceleration_Scaling_Factor: 0.5
Class: moveit_rviz_plugin/MotionPlanning
Enabled: true
Move Group Namespace: ""
Expand Down Expand Up @@ -193,7 +193,7 @@ Visualization Manager:
Show Robot Collision: false
Show Robot Visual: false
Value: true
Velocity_Scaling_Factor: 1
Velocity_Scaling_Factor: 0.5
Enabled: true
Global Options:
Background Color: 48; 48; 48
Expand Down
2 changes: 1 addition & 1 deletion mecharm/mecharm_moveit/launch/planning_context.launch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<arg name="robot_description" default="robot_description"/>

<!-- Load universal robot description format (URDF) -->
<param if="$(arg load_robot_description)" name="$(arg robot_description)" textfile="$(find mycobot_description)/urdf/mecharm/mecharm_urdf.urdf"/>
<param if="$(arg load_robot_description)" name="$(arg robot_description)" textfile="$(find mycobot_description)/urdf/mecharm_270_m5/mecharm_270_m5.urdf"/>

<!-- The semantic description that corresponds to the URDF -->
<param name="$(arg robot_description)_semantic" textfile="$(find mecharm_moveit)/config/firefighter.srdf" />
Expand Down
Loading

0 comments on commit 36adf30

Please sign in to comment.