Jingpei Lu

Fei Liu
email: f4liu@ucsd.edu

Cédric Girerd
email: cgirerd@ucsd.edu

Michael C Yip
email: yip@ucsd.edu

Image-based Pose Estimation and Shape Reconstruction for Robot Manipulators and Soft, Continuum Robots via Differentiable Rendering

State estimation from measured data is crucial for robotic applications as autonomous systems rely on sensors to capture the motion and localize in the 3D world. Among sensors that are designed for measuring a robot's pose, or for soft robots, their shape, vision sensors are favorable because they are information-rich, easy to set up, and cost-effective. With recent advancements in computer vision, deep learning-based methods no longer require markers for identifying feature points on the robot. However, learning-based methods are datahungry and hence not suitable for soft and prototyping robots, as building such bench-marking datasets is usually infeasible. In this work, we achieve image-based robot pose estimation and shape reconstruction from camera images. Our method requires no precise robot meshes, but rather utilizes a differentiable renderer and primitive shapes. It hence can be applied to robots for which CAD models might not be available or are crude. Our parameter estimation pipeline is fully differentiable. The robot shape and pose are estimated iteratively by back-propagating the image loss to update the parameters. We demonstrate that our method of using geometrical shape primitives can achieve high accuracy in shape reconstruction for a soft continuum robot and pose estimation for a robot manipulator.

I. INTRODUCTION

Sensory feedback of state parameters, such as the position and body configuration of a robot in its environment, is a fundamental requirement for operating autonomous systems in real-world, unknown spaces. In-place sensing may exist with motor encoders for robot manipulators, or Fiber Braggs for soft robots [START_REF] Shi | Shape sensing techniques for continuum robots in minimally invasive surgery: A survey[END_REF], all providing an estimate of their relative pose and body configurations in relation to the real world environment; however, the limitation is they all exhibit cumulative position errors due to long kinematic chains. In addition, for both soft and rigid robots, the procedure for mounting internal sensors can be tricky and wiring and communication lines can constrain the mechanics and articulation of the robot. That is why measuring the body configuration of a soft robot is notoriously challenging.

If the goal is to observe and track the motion of robots in the wild, e.g., for behavior cloning or offline reinforcement learning, the robot's state information may not be readily available or even accessible. A good example is in minimally invasive surgery (MIS), where over 1 million procedures are performed yearly on a daVinci Surgical Robot, many researchers are interested in automating aspects of the surgical procedures [START_REF] Yip | Robot autonomy for surgery[END_REF]. Video of surgeons all over the world using the same robot to perform tasks like suturing, where properly grasping suture needles is an expert skill for which data could be useful for learning control policies as shown in [START_REF] Chiu | Bimanual regrasping for suture needles using reinforcement learning for rapid motion planning[END_REF]. However, these datasets only have video data and lack kinematic data from the robot due to proprietary access.

Ultimately, in the above MIS and many other in-thewild robot scenarios, tracking the robot pose and body configurations directly from a camera offers the greatest flexibility. They are easy to set up or are already recording, do not require access to internal robot sensors, are affordable and widely ubiquitous. Traditionally, fiducial markers, like ArUco marker [START_REF] Garrido-Jurado | Automatic generation and detection of highly reliable fiducial markers under occlusion[END_REF] and AprilTag [START_REF] Olson | Apriltag: A robust and flexible visual fiducial system[END_REF], are widely used for robot pose estimation. These markers are attached to the specific locations of the robot and the robot state parameters can be estimated by knowing the kinematics model. However in most unstructured environments, it is unrealistic to have these markers attached; furthermore, in dirty environments like MIS or constrained environments, these markers can be permanently obscured or occluded. For soft robot applications, their body deformations and their tendency for full-body contact with environments and objects make it frequently impractical for securing fiducials or template markers.

The most flexible way to estimate pose from a camera is to do marker-less tracking. With recent advancements in Com-puter Vision, Convolutional Neural Networks (CNN) present a promising way for marker-less feature detection [START_REF] Lee | Camera-to-robot pose estimation from a single image[END_REF] [START_REF] Lu | Pose estimation for robot manipulators via keypoint optimization and sim-to-real transfer[END_REF] which no longer requires physical modification on the robot. In spite of the success of the CNN, training a neural network requires significant amounts of labeled datasets which is usually infeasible for soft robots and other robot prototypes, or where labeling of data is costly (e.g., MIS). Recently, in computer graphics, differentiable rendering has proved to be effective in image-based reconstruction by computing the derivative of images with respect to scene parameters such as camera pose and object geometry [8][9][10]. This could be translated to the task of marker-less pose tracking.

In this paper, we demonstrate the capability of estimating robot pose and configuration directly from a camera, as shown in Fig. 1. The method works via the technique of differentiable rendering, and can be effective both in rigidlink robot manipulators as well as soft continuum robots. This is uniquely challenging, as soft continuum robots have an infinite number of configurations, while some rigid robot manipulators may not come with predefined CAD models for their users (these are typically proprietary). Under these constraints, we are still able to estimate a robot's state without knowledge of a high-resolution CAD by introducing a flexible method involving shape primitives that work across a wide range of robots. Our contributions are:

1) We propose a general framework for parameter estimation by utilizing differentiable rendering with geometrical shape primitives.

2) The framework generalizes to both rigid and soft continuum robots for parameter estimation. 3) We investigate the novel loss functions to overcome the local minima when applying differentiable rendering to the objective of robot pose estimation. To examine the effectiveness of our framework, we collect a synthetic and a real dataset for a soft continuum robot and reconstruct the robot shape by estimating the curve parameters. We also evaluate our method on robot pose estimation where the 6 Degree-of-Freedom (DOF) camerato-robot pose for a Baxter robot is estimated with provided RGB images and joint encoder readings. The experimental results show that our method is out-performing the state-ofthe-art pose estimation algorithms.

II. PREVIOUS WORK

A few techniques in image-based estimation of robot poses and shapes have been previously explored.

Image-based Shape Reconstruction for Soft Continuum Robots: Image-based measurements of soft continuum robots are very task-specific and only work in certain environments. Techniques include using fluoroscopy [START_REF] Papalazarou | 3d catheter reconstruction using non-rigid structure-from-motion and robotics modeling[END_REF], [START_REF] Hoffmann | Semi-automatic catheter reconstruction from two views[END_REF] and ultrasound [START_REF] Waine | 3d shape visualization of curved needles in tissue from 2d ultrasound images using ransac[END_REF], [START_REF] Cheung | Enhancement of needle visibility in ultrasound-guided percutaneous procedures[END_REF]. These image-based techniques require specific imaging sources which might not always be available. [START_REF] Albeladi | Vision-based shape reconstruction of soft continuum arms using a geometric strain parametrization[END_REF], [START_REF] Cabras | An adaptive and fully automatic method for estimating the 3d position of bendable instruments using endoscopic images[END_REF], [START_REF] Reilink | Pose reconstruction of flexible instruments from endoscopic images using markers[END_REF] consider using endoscopic images for shape reconstruction while the markers are required for identifying predefined feature points. Moreover, [START_REF] Croom | Visual sensing of continuum robot shape using self-organizing maps[END_REF], [START_REF] Xu | Real-time shape recognition of a deformable link by using self-organizing map[END_REF] also introduce the shape reconstruction methods of using stereo images and depth data. In contrast, we will be focusing on markerless shape reconstruction from a single RGB camera.

Image-based Robot Pose Estimation: The common approach for image-based robot pose estimation is to attach the fiducial markers [START_REF] Garrido-Jurado | Automatic generation and detection of highly reliable fiducial markers under occlusion[END_REF], [START_REF] Olson | Apriltag: A robust and flexible visual fiducial system[END_REF] to known locations along the robot kinematic chain. Given the joint angles, the position of the marker in the robot base frame can be calculated and the robot pose can be derived by solving an optimization problem [START_REF] Li | Super: A surgical perception framework for endoscopic tissue manipulation with surgical robotics[END_REF], [START_REF] Ilonen | Robust robot-camera calibration[END_REF], [START_REF] Richter | Robotic tool tracking under partially visible kinematic chain: A unified approach[END_REF]. More recently, deep learning brings a promising way of marker-less pose estimation, where a CNN is trained to extract predefined feature points and the robot pose is estimated by solving the Perspective-n-Point problem [START_REF] Lambrecht | Towards the usage of synthetic data for marker-less pose estimation of articulated robots in rgb images[END_REF], [START_REF] Lee | Camera-to-robot pose estimation from a single image[END_REF], [START_REF] Lu | Super deep: A surgical perception framework for robotic tissue manipulation using deep learning for feature extraction[END_REF], [START_REF] Lu | Pose estimation for robot manipulators via keypoint optimization and sim-to-real transfer[END_REF]. Meanwhile, rendering-based methods also demonstrate their advantages in robot pose estimation by using the high-resolution robot CAD model for more precise estimation [START_REF] Hao | Vision-based surgical tool pose estimation for the da vinci® robotic surgical system[END_REF], [START_REF] Labbé | Single-view robot pose and joint angle estimation via render & compare[END_REF]. Our work utilizes differentiable rendering which requires no robot CAD model or large dataset for model training.

III. METHODOLOGY

We consider the problem of estimating the robot state parameters Θ from a single RGB image. Specifically, we estimate the robot pose and configurations by minimizing differences between the observed RGB image and a rendered reconstruction image. This is formulated as follows:

Θ * = arg min Θ L(f mask (I), f render (Θ)) (1)
where f mask processed the given RGB image I into a binarized mask image for the robot. The function f render takes in the estimated parameters, reconstructs the robot mesh, and renders the reconstruction. We aim to estimate the state parameters by minimizing the objective loss function L.

A visual of the final optimization process are shown in Fig. 2.

The process to get to this stage is described below.

M ref ← f mask (I) // Optimization loop 2 L min = ∞ 3 for i = 0 to N o do // Section III-B 4 M (i) ← reconstructM esh(Θ (i) state , Θ (i) verts ) // Section III-C 5 S (i) ← silhouetteRendering(M (i) ) 6 L (i) ← computeLoss(S (i) , M ref ) 7 if L (i) < L min then 8 L min = L (i) 9 Θ * state = Θ (i) state 10 Θ (i+1) verts = Θ (i) verts -λ verts ∂L (i) ∂Θ (i+1) verts 11 Θ (i+1) state = Θ (i) state -λ state ∂L (i) ∂Θ (i+1) state 12 return Θ * state A.

The State Parameter Estimation Framework

The overall framework for state parameter estimation is described in the Algorithm 1. We first process the observed RGB image I into a binary mask M ref , which segments the robot pixel from the background. The binary mask contains value 1 for the pixels that belong to the robot and 0 otherwise. In our implementation, the segmentation is achieved by color segmentation for the soft continuum robot (Section IV-B) and a CNN-based semantic segmentation for the robot manipulator (Section IV-C). We also initialize a robot mesh in a renderer as a set of geometrical primitive shapes with predefined vertices, edges, and faces.

During the iterative optimization process, we estimate the deformation of mesh vertices parameterized by Θ verts and reconstruct the robot mesh with state parameters Θ state (Section III-B). We render a silhouette image S from the reconstruction and compare it with the reference masked image M ref . A loss L is computed based on the curated objective functions (Section III-C). Since the full reconstruction and rendering pipeline is differentiable, a gradient on the loss may be taken with respect to the parameters and the objectives can be optimized (lines 11-12 in Algorithm 1). We iterate the optimization process for N o times and output the state parameters that minimize the objective loss.

B. Reconstruct Robot Mesh with Geometric Primitives

In this section, we describe the methods of reconstructing the robot mesh using geometric primitives for the soft and rigid robot, respectively. Note that state parameters Θ state and mesh vertex parameters Θ verts are defined differently according to their body types. 1) Mesh Reconstruction for Soft Continuum Robot: The shape of a soft continuum robot can be described in several ways, most easily using a constant curvature model [START_REF] Webster | Design and kinematic modeling of constant curvature continuum robots: A review[END_REF]. However, since this is a limiting approximation, instead a better model chosen is a Bézier curve model, which expresses a smooth and continuous curve with arbitrary curvature in 3D space. A Given a set of N control points {c i |c i ∈ R 3 } N i=0 , the shape of the curve is defined as:

C 0 C 1 C 2 (a) C 0 C 2 #» T #» N #» B (b) (c)
p(s) = N i=0 N ! i! (N -i)! (1 -s) N -i s i c i , 0 ≤ s ≤ 1, (2)
For simplicity, we use a quadratic Bézier curve (N = 2) and estimate the state of the control points Θ state (see Fig. 3a).

In general, the surface mesh for a continuum robot can be approximated as the tubular structure [START_REF] Li | Current trends and prospects in compliant continuum robots: A survey[END_REF]. A tubular surface is defined as a union of cross sections, and each cross-section is centered at the axis along the 3D curve, as shown in Fig 3 .  To describe 3D coordinate frames along a quadratic Bézier curve, we compute the Frenet-Serret frame which is defined by a unit vector T tangent to the curve, a unit vector N normal to the curve, and a unit vector B perpendicular to the tangent and normal vectors (Fig. 3b). The Frenet-Serret coordinates, parameterized by s, are defined as:

T(s) = p ′ (s) ∥p ′ (s)∥ N(s) = T ′ (s) ∥T ′ (s)∥ = p ′ (s) × (p ′′ (s) × p ′ (s)) ∥p ′ (s)∥ ∥p ′′ (s) × p ′ (s)∥ B(s) = T(s) × N(s) = p ′ (s) × p ′′ (s) ∥p ′ (s) × p ′′ (s)∥ (3)
where p ′ (s), p ′′ (s) are the first and second derivatives of the quadratic Bézier curve model:

p(s) = (1 -s) 2 c 0 + 2(1 -s)sc 1 + s 2 c 2 p ′ (s) = 2(1 -s)(c 1 -c 0 ) + 2s(c 2 -c 1 ) p ′′ (s) = 2(c 2 -2c 1 + c 0 ). (4)
Each cross-section is approximated as a circle with the radius r(s), and the corresponding tubular surface is defined as:

S(s, ϕ) = p(s) + r(s) [-N(s) cos ϕ + B(s) sin ϕ] (5)
with ϕ ∈ [0, 2π]. Since a point on the tubular surface can be specified by s and ϕ, we compute the mesh vertices by discretizing the tubular surface. The mesh vertices are then defined by a set of points on the tubular surface with two additional points at both ends of the curve,

V = {S(s i , ϕ i ), p(0), p(1) | i = 1, ..., N d } (6)
where s i , ϕ i are discrete points for surface vertices. The example of reconstructed surface mesh is shown in Fig. 3c.

During the optimization process, we adjust the mesh vertices by optimizing the radius of the cross sections Θ verts := r(s), and the robot mesh is formed with adjusted vertices.

2) Mesh Reconstruction for Robot Manipulator: A robot manipulator can generally be described as a chain of rigid links, and the 3D robot mesh is separated into a set of individual meshes of primitive shape. The number of individual meshes equals the number of rigid links and the meshes are connected by the rigid body transformations which indicate the position and rotation with respect to the robot base frame {b}. The transformation matrices T b n (q 1 , ..., q n ) ∈ SE(3) are parameterized by joint angles and can be computed from forward kinematics [START_REF] Denavit | A kinematic notation for lower-pair mechanisms based on matrices[END_REF].

We initialize the set of individual meshes as primitive shapes (e.g. boxes or cylinders) with predefined edges, faces, and vertices V primitive . Note that anything can be a primitive shape as long as there are only a few tunable parameters defining it, so a link shape template could be used. Regardless, during the optimization process, we adjust the robot mesh by estimating the offsets of each vertex:

v = v primitive + v offset (7)
where v primitive ∈ V primitive is the vertex initialized with the primitive shape mesh and v offset is the corresponding offset vector. The set of offset vectors has the same number of elements as V primitive , and is optimized at each iteration through gradient descent (Θ verts := V offset ).

To compose the robot mesh M for pose estimation, each individual mesh needs to be connected by the forward kinematics and transformed to the camera frame. Let v n ∈ R 3 be a vertex of the n-th link mesh, we transform the vertex to the camera frame as:

v c = T c b T b n (q 1 , ..., q n )v n (8)
where • represents the homogeneous representation of a point (e.g. v = [v, 1] T ). T b n (q 1 , ..., q n ) obtained from forward kinematics transforms mesh vertices to the robot base frame and T c b is the robot-to-camera transformation which is estimated using the Algorithm 1 (Θ state := T c b ).

C. Differentiable Rendering and Loss Functions

To render the image for robot mesh M, we use the PyTorch3D differentiable render [START_REF] Ravi | Accelerating 3d deep learning with pytorch3d[END_REF] for silhouette rendering. We set up the silhouette renderer with a perspective camera and a SoftSilhouetteShader which does not apply any lighting and shading. The differentiable renderer applies the rasterization algorithm which finds the mesh triangles that intersect each pixel and weights the influence according to the distance along the z-axis. Finally, the SoftSilhouetteShader computes pixel values of the rendered silhouette image using the sigmoid blending method [START_REF] Liu | Soft rasterizer: A differentiable renderer for image-based 3d reasoning[END_REF].

1) Objective Loss Functions for Shape Reconstruction:

To minimize the difference between the reconstructed silhouette image and the observed binary mask, the commonly used mask loss is applied. The mask loss computes the sum of the mean square error for every pixel,

L mask = H-1 i=0 W -1 j=0 S(i, j) -M ref (i, j) 2 . ( 9
)
H and W is the image height and width, S is the rendered silhouette image and M ref is the reference binary mask.

The mask loss will have non-informative gradients when there is no overlap (e.g. S(i, j) = 0 but M ref (i, j) = 1). Therefore we use an additional keypoint loss to guide the optimization from local minima when the silhouettes do not overlap. The keypoints loss is defined as:

L keypoint = K i=1 ∥π(p i ) -xi ∥ 2 ( 10
)
where K is the number of keypoints, xi is the i-th 2D keypoint extracted from center line of the reference mask M ref as shown in Fig. 5, and p i is the corresponding 3D keypoint on the Bézier curve. π(•) is the camera projection operator. Finally, the shape reconstruction loss is defined as:

L shape = λ mask L mask + λ keypoint L keypoint (11)
with λ mask , λ keypoint as loss weights.

2) Objective Loss Functions for Pose Estimation: For robot pose estimation, poor initialization would hamper the performance of the optimization algorithm by converging to local minima. In addition to the commonly used mask loss (Eq. 9), we propose distance loss and appearance loss to aid the optimization. The distance loss utilizes the distance map to propagate the gradient information to the entire image. The distance map D ref is defined as:

D ref (i, j) = 0, if M ref (i, j) = 1 dist(i,j) γ , otherwise (12)
where dist(i, j) is the distance from the pixel (i, j) to the closest pixel that has positive value 1, and γ is a discount factor (Fig. 4). We use the scikit-fmm package * which implements the fast marching method [START_REF] Sethian | Fast marching methods[END_REF] for computing the distance map. The distance loss is then calculated as:

L dist = H-1 i=0 W -1 j=0 S(i, j) * D ref (i, j) (13)
Since the reconstructed mask should have the same appearance as the observed mask, we introduce the appearance loss to force them to have the same number of positive pixels:

L app = H-1 i=0 W -1 j=0 S(i, j) - H-1 i=0 W -1 j=0 M ref (i, j) (14)
* https://pythonhosted.org/scikit-fmm The appearance loss is effective for preventing the robot pose from being too far or too close to the camera, through regulating the size of the rendered mask. Finally, the objective loss for pose estimation is defined as:

L pose = λ mask L mask + λ dist L dist + λ app L app (15)
where λ mask , λ dist , λ app are weights for the loss functions.

IV. EXPERIMENTS AND RESULTS

A. Datasets and Evaluation Metrics

Tendon-driven Octopus Arm dataset. Our experimental evaluations are conducted on a physical prototype of tendondriven octopus arm, visible in Fig. 1. It consists of a tapered cylinder of Ecoflex 00-30 (Smooth-On, Inc., Macungie, PA, USA) of length 200 mm, base and tip radius of 10 and 6 mm, respectively. It contains four channels for tendon actuation. The tendons are rigidly attached at the tip, and connected to spools actuated by harmonic drive motors at the base. The motors displace the tendons, leading to motions of the octopus arm. We collected the images using the ZED camera and the ground-truth robot shape is obtained with stereo reconstruction. For evaluation, we compare the center line of the reconstructed robot shape with the ground truth shape. The 2D and 3D errors of the center line are computed using the Euclidean distance of discrete points. Baxter dataset. The Baxter dataset from [START_REF] Lu | Pose estimation for robot manipulators via keypoint optimization and sim-to-real transfer[END_REF] provides 100 image frames of 20 different robot poses. The groundtruth end-effector position in 2D and 3D are provided. This dataset includes the challenging scenarios where the robot manipulator is self-occluded. The Percentage of Correct Keypoints (PCK) metric of the end-effector will be calculated according to [START_REF] Lu | Pose estimation for robot manipulators via keypoint optimization and sim-to-real transfer[END_REF], where the end-effector position in the camera frame is calculated based on the estimated robot pose.

B. Shape Reconstruction for Soft Continuum Robot 1) Implementation details: The RGB images are preprocessed to binary masks and the 2D center-line are extracted from the reference binary mask using the scikitimage (https://scikit-image.org) package, which implements the fast skeletonization method [START_REF] Zhang | A fast parallel algorithm for thinning digital patterns[END_REF]. We arbitrary predefined 4 keypoints along the center-line for loss computation, as shown in Fig. 5. For computing the mesh vertices, s is discretized to 100 and θ is discretized to 40 number of evenly spaced points. For the loss function, we set λ mask = 1 and λ keypoint = 100. We initialize the control points randomly but make sure the initialized mesh is within the camera frustum. The optimization loop is run for 200 iterations with a learning rate of 0.2.

2) Evaluation on the Octopus Arm Dataset: We evaluate our shape reconstruction method with different loss functions described in Section III-C.1. For the keypoint loss, we experimented with only using the endpoint and using all 4 keypoints. We report the averaged 2D and 3D center-line error and the results are shown in Table I. We can see that the error is dropped significantly by combining the mask loss and keypoint loss with only the endpoint. Considering more keypoints further improves our performance of shape reconstruction as they provide more guidance for optimization. The qualitative results are shown in the Fig. 6, where we show the rendered silhouette images of the reconstructed robot mesh (left) and, the reconstructed 3D robot shape, and the robot trajectory (right).

C. Pose Estimation for Robot Manipulator 1) Implementation details:

To segment the robot from the background, we trained the DeepLabV3 [START_REF] Chen | Rethinking atrous convolution for semantic image segmentation[END_REF] with 10K synthetic image data generated using the CoppeliaSim [START_REF] Rohmer | V-rep: A versatile and scalable robot simulation framework[END_REF]. We applied Domain Randomization [START_REF] Tobin | Domain randomization for transferring deep neural networks from simulation to the real world[END_REF] so that the trained network can generalize to the real images. We initialize the primitive shape meshes for each link with the length, width, and height that are described in the robot description file. The deformed vertices v deformed are initialized to zeros and the robot poses are initialized randomly but within the camera frustum. For loss function, we set the weights as λ mask = 1, λ dist = 1, λ app = 1 and γ = 100 when computing the distance map. We optimize parameters for 500 iterations with a learning rate of 1e-2 for camera pose parameters and 1e-4 for the deformed vertices.

2) Evaluation on Baxter Dataset: We evaluate our method of robot pose estimation on the Baxter dataset and compare it against the state-of-the-art methods [START_REF] Lee | Camera-to-robot pose estimation from a single image[END_REF], [START_REF] Lu | Pose estimation for robot manipulators via keypoint optimization and sim-to-real transfer[END_REF], as shown in

PCK2D PCK3D

@50 pixel @100 pixel @150 pixel @200 pixel @100 mm @200 mm @300 mm @400 mm Notice that the averaged error is large because of outliers, and 95% of the estimates have less than 4 cm error as shown in Table II.

Table II. We applied our method with two different shape primitive meshes, the box and cylinder. We also report the performance of using the robot CAD model with differentiable rendering. The Percentage of Correct Keypoints (PCK, higher is better) results are reported for both 2D and 3D at different thresholds. The experimental results show that our method of using primitive shapes outperforms the state-ofthe-art methods and achieves comparable performance with using the high-resolution robot CAD model.

3) Ablation Study on Loss Functions: Here, we study the effectiveness of the loss functions proposed in Section III-C.2 using the Baxter dataset. We experiment with our robot pose estimation method (cylinder) with different loss combinations and calculate 3D end-effector error using the Euclidean Distance. We plot the average 3D end-effector error at each iteration in Fig. 7. With only the mask loss, the algorithm suffers from bad initialization and cannot converge robustly. The distance loss helps the convergence by propagating the gradient information to every image pixel. Finally, by combining all three losses, we achieve a more robust convergence for robot pose estimation.

V. CONCLUSION

In this paper, we demonstrate the capability of measuring robot pose and configuration state parameters directly from a camera, as shown in Fig. 1. The method works via the technique of differentiable rendering, and can be effective both in rigid-link robot manipulators as well as soft continuum robots. we show that several definitions for optimization losses are useful to overcome the local minima when applying differentiable rendering to the objective of robot pose estimation. We evaluated our method on relatively unstructured environments of continuum and rigid robots showing its efficacy in pose estimation. Ultimately, this work helps to enable robot state estimation and tracking in the wild, with greater opportunities in useful dataset curation, behavioral cloning and visual learning.

Fig. 1 .

 1 Fig. 1. Robot shape reconstruction and pose estimation via differentiable rendering. The top row shows the real images. The bottom row shows the estimated robot shape (left) and pose (right).

Fig. 2 .

 2 Fig.2. Visualization of the optimization process. We show the rendered silhouettes at different iterations to demonstrate the convergence of our algorithm.

Algorithm 1 :

 1 Robot State Parameter Estimation via Differentiable Rendering Input : Image frame I, initialization Θ Estimated robot state parameters Θ * state // Generate robot masks 1

Fig. 3 .

 3 Fig. 3. Illustration of surface mesh construction for soft continuum robot, with (a) the Bézier curve and control points, (b) the Frenet-Serret frame of cross section, and (c) the constructed surface mesh.

Fig. 4 .Fig. 5 .

 45 Fig. 4. Visualization of the distance map, with (a) the reference binary mask and (b) the corresponding distance map.

Fig. 6 .

 6 Fig. 6. Reconstruction results for the Octopus Arm dataset, with (a) the reference RGB images and shape reconstruction results for different losses are shown for 4 example frames that cover a large range of motion and (b) the reconstructed 3D robot shape of the picked frames and the entire robot trajectory.TABLE II COMPARISON OF OUR METHODS WITH THE STATE-OF-THE-ART METHODS ON ROBOT POSE ESTIMATION.

Fig. 7 .

 7 Fig. 7. Ablation study of the loss functions for robot pose estimation.Notice that the averaged error is large because of outliers, and 95% of the estimates have less than 4 cm error as shown in TableII.

TABLE I 2D

 I AND 3D ERROR (MEAN e AND STANDARD DEVIATION σ) OF SHAPE RECONSTRUCTION ON REAL OCTOPUS ARM DATASET.

	Losses	e 2D (pixel)	σ 2D	e 3D	σ 3D
	Mask	12.462	8.690	8.720	2.534
	Mask + endpoint	3.898	2.216	7.299	3.900
	Mask + 4 keypoints	3.276	0.785	6.915	2.096

TABLE II COMPARISON

 II OF OUR METHODS WITH THE STATE-OF-THE-ART METHODS ON ROBOT POSE ESTIMATION.

This project was funded by the US Army Telemedicine and Advanced Technologies Research Center and NSF Awards #2045803 and #1935329.