浏览代码

Making pick_and_place Noetic compatible (#58)

* Making pick_and_place Noetic compatible
/fix-file-mode
GitHub 4 年前
当前提交
9d5b71a7
共有 3 个文件被更改,包括 18 次插入5 次删除
  1. 11
      tutorials/pick_and_place/2_ros_tcp.md
  2. 2
      tutorials/pick_and_place/ROS/src/niryo_moveit/config/params.yaml
  3. 10
      tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/mover.py

11
tutorials/pick_and_place/2_ros_tcp.md


## The ROS side
> Note: This project was built using the ROS Melodic distro and Python 2.
> Note: This project has been tested with Python 2 and ROS Melodic, as well as Python 3 and ROS Noetic.
1. The provided files require the following packages to be installed; run the following if the packages are not already present:
1. The provided files require the following packages to be installed. ROS Melodic users should run the following commands if the packages are not already present:
sudo -H pip install rospkg jsonpickle
ROS Noetic users should run:
sudo -H pip install rospkg jsonpickle
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python3-pip ros-noetic-robot-state-publisher ros-noetic-moveit ros-noetic-rosbridge-suite ros-noetic-joy ros-noetic-ros-control ros-noetic-ros-controllers
sudo -H pip3 install rospkg jsonpickle
```
> In your ROS workspace, find the directory `src/niryo_moveit/scripts`. Note the file `server_endpoint.py`. This script imports the necessary dependencies from tcp_endpoint and starts the server. `rospy.spin()` ensures the node does not exit until it is shut down.

2
tutorials/pick_and_place/ROS/src/niryo_moveit/config/params.yaml


ROS_IP: 127.0.0.1
ROS_IP: 127.0.0.1

10
tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/mover.py


joint_names = ['joint_1', 'joint_2', 'joint_3', 'joint_4', 'joint_5', 'joint_6']
# Between Melodic and Noetic, the return type of plan() changed. moveit_commander has no __version__ variable, so checking the python version as a proxy
if sys.version_info >= (3, 0):
def planCompat(plan):
return plan[1]
else:
def planCompat(plan):
return plan
"""
Given the start angles of the robot, plan a trajectory that ends at the destination pose.
"""

""".format(destination_pose, destination_pose)
raise Exception(exception_str)
return move_group.plan()
return planCompat(move_group.plan())
"""

正在加载...
取消
保存