Object Pose Estimation Tutorial: Part 0
October 27, 2021 ยท View on GitHub
This page provides steps on how to manually set up a catkin workspace for the Pose Estimation tutorial.
-
Navigate to the root
Robotics-Object-Pose-Estimation/directory of this downloaded repository. This directory will be used as the ROS catkin workspace. -
Copy or download this directory to your ROS operating system if you are doing ROS operations in another machine, VM, or container.
-
If the following packages are not already installed on your ROS machine, run the following commands to install them:
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 ros-noetic-tf* ros-noetic-gazebo-ros-pkgs ros-noetic-joint-state-publisher
sudo pip3 install rospkg numpy jsonpickle scipy easydict torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
Note: If you encounter errors installing Pytorch via the above
pip3command, try the following instead:sudo pip3 install rospkg numpy jsonpickle scipy easydict torch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
Most of the ROS setup has been provided via the ur3_moveit package. This section will describe the provided files.
- If you have not already built and sourced the ROS workspace since importing the new ROS packages, navigate to your ROS workplace, and run:
catkin_make -DCATKIN_WHITELIST_PACKAGES="moveit_msgs;ros_tcp_endpoint;ur3_moveit;robotiq_2f_140_gripper_visualization;ur_description;ur_gazebo"
source devel/setup.bash
Note: This
catkin_makecommand specifies the packages to build for this project, as the dependent repositories include extra packages that are not used for this demo and may cause build issues.
Ensure there are no unexpected errors.
The ROS parameters will need to be set to your configuration in order to allow the server endpoint to fetch values for the TCP connection.
- Navigate to your ROS workspace (e.g.
~/catkin_ws). Assign the ROS IP in theparams.yamlfile as follows:
echo "ROS_IP: $(hostname -I)" > src/ur3_moveit/config/params.yaml
Note: You can also manually assign this value by navigating to the
src/ur3_moveit/config/params.yamlfile and opening it for editing.ROS_IP: <your ROS IP>e.g.
ROS_IP: 10.0.0.250
Note: Learn more about the server endpoint and ROS parameters here.
This YAML file is a rosparam set from the launch files provided for this tutorial, which has been copied below for reference. Additionally, the server_endpoint, pose estimation, and mover nodes are launched from this file.
<launch>
<rosparam file="$(find ur3_moveit)/config/params.yaml" command="load"/>
'<include file="$(find ur3_moveit)/launch/demo.launch" />
<node name="server_endpoint" pkg="ur3_moveit" type="server_endpoint.py" args="--wait" output="screen" respawn="true" />
<node name="pose_estimation" pkg="ur3_moveit" type="pose_estimation_script.py" args="--wait" output="screen"/>
<node name="mover" pkg="ur3_moveit" type="mover.py" args="--wait" output="screen" respawn="true" respawn_delay="2.0"/>
</launch>
Note: The launch files for this project are available in the package's launch directory, i.e.
src/ur3_moveit/launch/.
The ROS workspace is now ready to accept commands! Return to Part 4: Set up the Unity side to continue the tutorial.