This repository is structured as a Catkin/ROS workspace containing a single Catkin package (object_detection_msgs) used to build ROS service messages. Alongside the typical Catkin folder structure, we have changed the repository structure as little as possible from the original setup.
NOTE: The following commands have not been verified to work until this comment is removed.
If you do not have the Docker image, you can pull it using the command:
docker pull lhy0807/haptic-refiner:ros1If for some reason you cannot pull the image, you may be able to build the image only if your machine has much more than 32 GB of RAM (it has worked with 128 GB RAM but we do not know if 64 GB would be enough). With this in mind, as a last resort, you can build the image by running:
sh docker/build_ros1.shTo enter the Docker container, run:
sh docker/run_container_ros1.shIf it's the first time you've launched the container, you need to build FoundationPose. Run this command inside the Docker container:
sh /docker/pose/FoundationPose/build_all.shYou'll also need to download the network weights for FoundationPose. Run the command:
sh /docker/pose/docker/download_weights.shWe use CNOS for object segmentation as a preprocessing step for pose estimation. CNOS requires a CAD model of each novel object, used to render "templates" of the object from various views.
Because we couldn't get the CNOS template rendering to run locally, when we scan new object mesh files (.obj), send them to Hongyu to get CNOS templates. You can convert .usdz files to .obj online using sites such as this or this.
To build the ROS messages needed for pose estimation, run:
pip install empy==3.3.4
cd /docker/pose/pose_ws
catkin_makeThe run_spot.py script verifies that the pose estimation system can receive data
from the robot. You'll need two Terminal tabs, one in the pose Docker and one in
the spot-tamp-gpu Docker (from spot_skills). Follow these steps:
- Verify Ethernet Connection - Verify that you can communicate with Spot over Ethernet from within Docker. Note that the example IP address corresponds to Snouter via Ethernet (other Spots will vary):
root@terminist:/docker/spot_skills# ping 138.16.160.90
PING 138.16.160.90 (138.16.160.90) 56(84) bytes of data.
64 bytes from 138.16.160.90: icmp_seq=1 ttl=64 time=0.374 ms
...
^C
--- 138.16.160.90 ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8186ms
- Launch Spot ROS Driver - Enter the
spot_skillsDocker and launch the Spot ROS driver with RViz enabled:
roslaunch spot_skills authenticate_spot_driver.launch rviz:=true load_robot_description:=trueYou should see the Spot in RViz reflect the configuration of the physical Spot, such as:
- Launch Pose Estimator - Finally, in the
poseDocker, run the following commands:
cd /docker/pose/real
source ../pose_ws/devel/setup.bash
python run_spot.pyThe pose_estimation_server.py script provides the pose estimation service to be
used by the rest of our codebase over in spot_skills. To run the service, open
two Terminal tabs, one in the pose Docker and the other in spot-tamp-gpu
(from spot_skills). Follow these steps:
-
Verify Ethernet Connection - Verify that you can communicate with Spot over Ethernet from within Docker. Note that the example IP address below is for Snouter; other Spots will use different IP addresses.
root@terminist:/docker/spot_skills# ping 138.16.160.90 PING 138.16.160.90 (138.16.160.90) 56(84) bytes of data. 64 bytes from 138.16.160.90: icmp_seq=1 ttl=64 time=0.374 ms ... ^C --- 138.16.160.90 ping statistics --- 9 packets transmitted, 9 received, 0% packet loss, time 8186ms -
Launch the pose estimation service client from the
spot_skillsDocker:source devel/setup.bash roslaunch spot_skills pose_estimation_demo.launch -
Launch the pose estimation service server from the
poseDocker:sh /docker/pose/run_service.sh
