Voxel grid implementation #76
build_and_unitest.yml
on: pull_request
Setup Environment
15s
Matrix: Build/Test
Confirm Build and Unit Tests Completed
3s
Annotations
100 errors and 5 notices
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L1
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L1
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L18
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L23
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L23
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L26
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L29
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L39
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L41
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L50
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L57
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L62
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L76
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L86
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L90
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L92
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L102
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L106
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L106
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/ros2_voxel.py#L10
from std_msgs.msg import Header
import sensor_msgs_py.point_cloud2 as pc2
+
class VoxelGridNode(Node):
def __init__(self):
super().__init__('voxel_grid_node')
-
+
self.rgb_sub = self.create_subscription(
Image, '/camera/color/image_raw', self.rgb_callback, 10)
self.depth_sub = self.create_subscription(
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L131
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/ros2_voxel.py#L22
CameraInfo, '/camera/depth/camera_info', self.info_callback, 10)
self.voxel_pub = self.create_publisher(PointCloud2, '/voxel_grid', 10)
-
+
self.rgb_image = None
self.depth_image = None
self.bridge = CvBridge()
-
+
# Camera intrinsics (ovewrritten for your camera)
self.fx, self.fy, self.cx, self.cy = 525.0, 525.0, 320.0, 240.0
-
- self.voxel_size = 0.04
- self.max_range = 3.5
-
+
+ self.voxel_size = 0.04
+ self.max_range = 3.5
+
self.get_logger().info('Voxel Grid Node started')
def info_callback(self, msg):
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L142
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/ros2_voxel.py#L52
def process_rgbd_if_ready(self):
if self.rgb_image is None or self.depth_image is None:
return
-
+
# Convert RGBD to point cloud
points = self.rgbd_to_pointcloud(self.rgb_image, self.depth_image)
-
+
if len(points) > 0:
# Create voxel grid
voxel_centers = self.create_voxel_grid(points)
-
+
# Publish voxel grid as point cloud
self.publish_voxel_grid(voxel_centers)
def rgbd_to_pointcloud(self, rgb, depth):
points = []
h, w = depth.shape
-
- for v in range(0, h, 4): #Skipping every 4 pixels to downsample, can change if nessary
+
+ for v in range(0, h, 4): # Skipping every 4 pixels to downsample, can change if nessary
for u in range(0, w, 4):
- z = depth[v, u] / 1000.0
-
- if z > 0.1 and z < self.max_range:
+ z = depth[v, u] / 1000.0
+
+ if z > 0.1 and z < self.max_range:
x = (u - self.cx) * z / self.fx
y = (v - self.cy) * z / self.fy
points.append([x, y, z])
-
+
return np.array(points, dtype=np.float32)
def create_voxel_grid(self, points):
points_scaled = points / self.voxel_size
-
+
min_coords = points_scaled.min(axis=0)
max_coords = points_scaled.max(axis=0)
padding = 2.0
-
+
coors_range = [
min_coords[0] - padding, min_coords[1] - padding, min_coords[2] - padding,
max_coords[0] + padding, max_coords[1] + padding, max_coords[2] + padding
]
-
+
voxel_gen = PointToVoxel(
- vsize_xyz=[1.0, 1.0, 1.0],
+ vsize_xyz=[1.0, 1.0, 1.0],
coors_range_xyz=coors_range,
num_point_features=3,
max_num_voxels=10000,
max_num_points_per_voxel=20
)
-
+
pc_tensor = torch.from_numpy(points_scaled)
voxels, indices, num_points_per_voxel = voxel_gen(pc_tensor)
-
- voxel_centers = indices.numpy() * self.voxel_size + np.array(coors_range[:3]) * self.voxel_size + self.voxel_size/2
-
+
+ voxel_centers = indices.numpy() * self.voxel_size + \
+ np.array(coors_range[:3]) * self.voxel_size + self.voxel_size/2
+
self.get_logger().info(f'Created {len(voxels)} voxels from {len(points)} points')
-
+
return voxel_centers
def publish_voxel_grid(self, voxel_centers):
header = Header()
header.stamp = self.get_clock().now().to_msg()
header.frame_id = 'camera_link'
-
+
fields = [
PointField(name='x', offset=0, datatype=PointField.FLOAT32, count=1),
PointField(name='y', offset=4, datatype=PointField.FLOAT32, count=1),
PointField(name='z', offset=8, datatype=PointField.FLOAT32, count=1),
]
-
+
pc_msg = pc2.create_cloud(header, fields, voxel_centers)
self.voxel_pub.publish(pc_msg)
+
def main(args=None):
rclpy.init(args=args)
node = VoxelGridNode()
-
+
try:
rclpy.spin(node)
except KeyboardInterrupt:
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L148
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/ros2_voxel.py#L134
node.destroy_node()
rclpy.shutdown()
+
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L151
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/test_voxel.py#L5
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
+
def load_bunny_data():
with open('bunnyData.pts', 'r') as f:
lines = f.readlines()
-
+
num_points = int(lines[0].strip())
points = []
-
+
for i in range(1, min(num_points + 1, len(lines))):
line = lines[i].strip()
if line:
coords = list(map(float, line.split()))
if len(coords) >= 3:
points.append(coords[:3])
-
+
points = np.array(points, dtype=np.float32)
print(f"Loaded {len(points)} points from bunnyData.pts")
print(f"Range: X[{points[:, 0].min():.3f}, {points[:, 0].max():.3f}] "
f"Y[{points[:, 1].min():.3f}, {points[:, 1].max():.3f}] "
f"Z[{points[:, 2].min():.3f}, {points[:, 2].max():.3f}]")
-
+
return points
+
def create_voxel_grid(points, voxel_size=2.0):
"""Convert point cloud to voxel grid"""
# Scale to mm for better voxel resolution
points_scaled = points * 1000
-
+
min_coords = points_scaled.min(axis=0)
max_coords = points_scaled.max(axis=0)
padding = 5.0
-
+
coors_range = [
min_coords[0] - padding, min_coords[1] - padding, min_coords[2] - padding,
max_coords[0] + padding, max_coords[1] + padding, max_coords[2] + padding
]
-
+
# Create voxel generator
voxel_gen = PointToVoxel(
vsize_xyz=[voxel_size, voxel_size, voxel_size],
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L161
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/test_voxel.py#L50
max_num_voxels=20000,
max_num_points_per_voxel=50
)
-
+
# Generate voxels
pc_tensor = torch.from_numpy(points_scaled)
voxels, indices, num_points_per_voxel = voxel_gen(pc_tensor)
-
+
# Convert voxel indices to world coordinates
voxel_centers = indices.numpy() * voxel_size + np.array(coors_range[:3]) + voxel_size/2
-
+
print(f"Created {len(voxels)} voxels from {len(points)} points")
print(f"Voxel size: {voxel_size}mm")
-
+
return voxel_centers, voxels, indices
+
def visualize_voxels(voxel_centers):
"""Create 3D visualization of voxel grid"""
fig = plt.figure(figsize=(12, 10))
ax = fig.add_subplot(111, projection='3d')
-
+
# Color by Z-coordinate
colors = voxel_centers[:, 2]
-
+
scatter = ax.scatter(voxel_centers[:, 0], voxel_centers[:, 1], voxel_centers[:, 2],
- c=colors, cmap='viridis', s=30, alpha=0.8)
-
+ c=colors, cmap='viridis', s=30, alpha=0.8)
+
# Add colorbar
cbar = plt.colorbar(scatter, ax=ax, shrink=0.5)
cbar.set_label('Z Coordinate (mm)')
-
+
ax.set_xlabel('X (mm)')
ax.set_ylabel('Y (mm)')
ax.set_zlabel('Z (mm)')
ax.set_title('Voxel Grid Visualization')
ax.grid(True, alpha=0.3)
ax.view_init(elev=20, azim=45)
-
+
plt.savefig('voxel_visualization.png', dpi=150, bbox_inches='tight')
print("Saved visualization as 'voxel_visualization.png'")
plt.show()
+
def test_basic_functionality():
"""Test basic voxel generation with synthetic data"""
print("Testing basic voxel functionality...")
-
+
# Generate random point cloud
np.random.seed(42)
points = np.random.uniform(-2, 2, size=[1000, 3]).astype(np.float32)
-
+
voxel_gen = PointToVoxel(
vsize_xyz=[0.1, 0.1, 0.1],
coors_range_xyz=[-3, -3, -3, 3, 3, 3],
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L168
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/test_voxel.py#L104
max_num_voxels=5000,
max_num_points_per_voxel=10
)
-
+
pc_tensor = torch.from_numpy(points)
voxels, indices, num_points = voxel_gen(pc_tensor)
-
+
print(f"Input: {len(points)} points")
print(f"Output: {len(voxels)} voxels")
print(f"Voxel shape: {voxels.shape}")
print(f"Average points per voxel: {num_points.float().mean():.2f}")
-
+
return True
+
def main():
"""Main execution flow"""
print("Voxel Grid Processing")
print("-" * 40)
-
+
# Test basic functionality first
test_basic_functionality()
print()
-
+
# Process bunny data if available
try:
points = load_bunny_data()
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L171
code should be clang-formatted [-Wclang-format-violations]
|
|
utils/voxel/test_voxel.py#L134
except Exception as e:
print(f"Error processing bunny data: {e}")
+
if __name__ == "__main__":
- main()
-
\ No newline at end of file
+ main()
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L174
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/STM32/linker_flags.py#L1
Import("env")
env.Append(
- LINKFLAGS=[
- "-mfpu=fpv4-sp-d16",
- "-mfloat-abi=hard"
- ]
-)
\ No newline at end of file
+ LINKFLAGS=[
+ "-mfpu=fpv4-sp-d16",
+ "-mfloat-abi=hard"
+ ]
+)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L180
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/STM32/rename_bin.py#L2
env_name = env["PIOENV"]
-env.Replace(PROGNAME=env_name)
\ No newline at end of file
+env.Replace(PROGNAME=env_name)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L185
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/perception/setup.py#L32
'dummy_publisher_node = perception.dummy_publisher_node:main'
],
},
-)
\ No newline at end of file
+)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L189
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/perception/perception/dummy_publisher_node.py#L66
# Add slight depth variation (noise)
depth_noise = np.random.randint(-30, 30, depth_image.shape, dtype=np.int16)
- depth_image = np.clip(depth_image.astype(np.int32) + depth_noise, 0, 65535).astype(np.uint16)
+ depth_image = np.clip(depth_image.astype(np.int32) +
+ depth_noise, 0, 65535).astype(np.uint16)
rgb_msg = self.bridge.cv2_to_imgmsg(
rgb_image, encoding='bgr8'
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L206
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/perception/launch/perception.launch.py#L11
default_value='info',
description='Log level for the dummy publisher node'
),
-
+
Node(
package='perception',
executable='dummy_publisher_node',
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L218
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L225
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/perception/launch/perception.launch.py#L24
# Add any topic remappings here if needed
]
)
- ])
\ No newline at end of file
+ ])
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L225
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/setup.py#L32
'voxel_grid_node = voxel_grid.voxel_grid_node:main'
],
},
-)
\ No newline at end of file
+)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L228
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L229
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py#L42
self.fx, self.fy, self.cx, self.cy = 525.0, 525.0, 320.0, 240.0
self.have_intrinsics = False
- self.voxel_size = 0.04
- self.max_range = 3.5
- self.min_range = 0.1
- self.stride = 4
+ self.voxel_size = 0.04
+ self.max_range = 3.5
+ self.min_range = 0.1
+ self.stride = 4
self.get_logger().info('Voxel Grid Node started (world modelling, headless)')
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L229
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py#L89
self.cy = float(msg.k[5])
self.have_intrinsics = True
- self.get_logger().info(f'Intrinsics updated: fx={self.fx:.2f}, fy={self.fy:.2f}, cx={self.cx:.2f}, cy={self.cy:.2f}')
+ self.get_logger().info(
+ f'Intrinsics updated: fx={self.fx:.2f}, fy={self.fy:.2f}, cx={self.cx:.2f}, cy={self.cy:.2f}')
def rgb_callback(self, msg: Image):
self.rgb_image = self._decode_rgb_bgr8(msg)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L232
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py#L117
self.publish_voxel_grid(voxel_centers)
- #reset
+ # reset
self.depth_image = None
self.rgb_image = None
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L237
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py#L165
voxel_gen = PointToVoxel(
vsize_xyz=[self.voxel_size, self.voxel_size, self.voxel_size],
- coors_range_xyz=coors_range_m.tolist(), #Convert numpy to python
+ coors_range_xyz=coors_range_m.tolist(), # Convert numpy to python
num_point_features=3,
max_num_voxels=10000,
max_num_points_per_voxel=20
)
pc_tensor = torch.from_numpy(points) # float32
- voxels, indices, num_points = voxel_gen(pc_tensor) # indices: [M, 3] (z,y,x) or (x,y,z) depending on impl
+ # indices: [M, 3] (z,y,x) or (x,y,z) depending on impl
+ voxels, indices, num_points = voxel_gen(pc_tensor)
if indices.numel() == 0:
return np.zeros((0, 3), dtype=np.float32)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L237
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py#L192
def publish_voxel_grid(self, voxel_centers: np.ndarray):
header = Header()
header.stamp = self.get_clock().now().to_msg()
- header.frame_id = 'camera_link'
+ header.frame_id = 'camera_link'
fields = [
PointField(name='x', offset=0, datatype=PointField.FLOAT32, count=1),
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L238
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/voxel_grid/launch/voxel_grid.launch.py#L10
executable='voxel_grid_node',
output='screen',
emulate_tty=True),
- ])
\ No newline at end of file
+ ])
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L238
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/setup.py#L32
'octo_map_node = octo_map.octo_map_node:main'
],
},
-)
\ No newline at end of file
+)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L242
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/octo_map/octo_map_node.py#L10
from std_msgs.msg import Header
import sensor_msgs_py.point_cloud2 as pc2
+
class OctoMapNode(Node):
def __init__(self):
super().__init__('octo_map_node')
-
+
# Subscribe to processed perception data
self.rgb_sub = self.create_subscription(
Image, '/perception/rgb_processed', self.rgb_callback, 10)
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L255
code should be clang-formatted [-Wclang-format-violations]
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L255
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/octo_map/octo_map_node.py#L23
CameraInfo, '/perception/camera_info', self.info_callback, 10)
self.octo_pub = self.create_publisher(PointCloud2, '/behaviour/octo_map', 10)
-
+
self.rgb_image = None
self.depth_image = None
self.bridge = CvBridge()
-
+
# Camera intrinsics (will be updated from camera info)
self.fx, self.fy, self.cx, self.cy = 525.0, 525.0, 320.0, 240.0
-
- self.voxel_size = 0.04
- self.max_range = 3.5
-
+
+ self.voxel_size = 0.04
+ self.max_range = 3.5
+
self.get_logger().info('OctoMap Node started - subscribing to processed perception data')
def info_callback(self, msg):
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L266
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/octo_map/octo_map_node.py#L58
# TODO: Implement point cloud generation and octomap updating
-
+
def main(args=None):
rclpy.init(args=args)
node = OctoMapNode()
-
+
try:
rclpy.spin(node)
except KeyboardInterrupt:
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L266
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/octo_map/octo_map_node.py#L71
node.destroy_node()
rclpy.shutdown()
+
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L272
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/behaviour/octo_map/launch/octo_map.launch.py#L10
executable='octo_map_node',
output='screen',
emulate_tty=True),
- ])
\ No newline at end of file
+ ])
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L272
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_subscriber.py#L1
import rclpy
from rclpy.node import Node
from std_msgs.msg import Float32MultiArray
+
class HandPoseSubscriber(Node):
def __init__(self):
|
|
embedded/ESP32S3/gimbal_motor_testing/src/main.cpp#L295
code should be clang-formatted [-Wclang-format-violations]
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_subscriber.py#L18
self.joint_positions = list(msg.data)
self.get_logger().info(f'Received joint positions: {self.joint_positions}')
else:
- self.get_logger().warn(f'Received invalid joint positions: expected 15 floats, got {len(msg.data)}')
+ self.get_logger().warn(
+ f'Received invalid joint positions: expected 15 floats, got {len(msg.data)}')
def get_latest_joint_positions(self):
return self.joint_positions
+
def main(args=None):
rclpy.init(args=args)
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_subscriber.py#L33
node.destroy_node()
rclpy.shutdown()
+
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/hand_test.py#L1
+from test_subscriber import HandPoseSubscriber
+from test_publisher import TestFloatPublisher
+from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR
+from HumanoidRL.HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import HAND_CFG
+from isaaclab.utils import configclass
+from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
+from isaaclab.managers import SceneEntityCfg
+from isaaclab.assets import AssetBaseCfg
+import isaaclab.sim as sim_utils
+import rclpy
+import torch
import argparse
from isaaclab.app import AppLauncher
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/hand_test.py#L8
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
-import torch
-import rclpy
-
-import isaaclab.sim as sim_utils
-from isaaclab.assets import AssetBaseCfg
-from isaaclab.managers import SceneEntityCfg
-from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
-from isaaclab.utils import configclass
-
-from HumanoidRL.HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import HAND_CFG
-from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR
-from test_publisher import TestFloatPublisher
-from test_subscriber import HandPoseSubscriber
@configclass
class HandSceneCfg(InteractiveSceneCfg):
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/hand_test.py#L36
)
robot = HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
+
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene, node, test_node):
robot = scene["robot"]
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/hand_test.py#L67
robot.set_joint_position_target(joint_pos_des, joint_ids=robot_entity_cfg.joint_ids)
else:
print("[INFO]: No valid joint values received, using default positions.")
- joint_position_list = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]]
+ joint_position_list = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]]
joint_position = torch.tensor(joint_position_list[0], device=sim.device)
robot.reset()
joint_pos_des = joint_position.unsqueeze(0)[:, robot_entity_cfg.joint_ids].clone()
robot.set_joint_position_target(joint_pos_des, joint_ids=robot_entity_cfg.joint_ids)
-
scene.write_data_to_sim()
sim.step()
scene.update(sim_dt)
+
def main():
# Initialize ROS2
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/hand_test.py#L102
rclpy.shutdown()
simulation_app.close()
+
if __name__ == "__main__":
- main()
\ No newline at end of file
+ main()
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_publisher.py#L1
import rclpy
from rclpy.node import Node
from std_msgs.msg import Float32MultiArray
+
class TestFloatPublisher(Node):
def __init__(self):
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_publisher.py#L16
self.publisher_.publish(msg)
self.get_logger().info(f'Published joint positions: {msg.data}')
+
def main(args=None):
rclpy.init(args=args)
node = TestFloatPublisher()
|
|
autonomy/simulation/Wato_additional_scripts/ros2_bridge/test_publisher.py#L26
node.destroy_node()
rclpy.shutdown()
+
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/joint_space_test.py#L1
+from isaaclab_assets import UR10_CFG
+from isaaclab.utils.math import subtract_frame_transforms
+from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
+from isaaclab.utils import configclass
+from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
+from isaaclab.markers.config import FRAME_MARKER_CFG
+from isaaclab.markers import VisualizationMarkers
+from isaaclab.managers import SceneEntityCfg
+from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg
+from isaaclab.assets import AssetBaseCfg
+import isaaclab.sim as sim_utils
+import torch
import argparse
from isaaclab.app import AppLauncher
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/joint_space_test.py#L8
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
-import torch
-
-import isaaclab.sim as sim_utils
-from isaaclab.assets import AssetBaseCfg
-from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg
-from isaaclab.managers import SceneEntityCfg
-from isaaclab.markers import VisualizationMarkers
-from isaaclab.markers.config import FRAME_MARKER_CFG
-from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
-from isaaclab.utils import configclass
-from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.utils.math import subtract_frame_transforms
##
# Pre-defined configs
##
-from isaaclab_assets import UR10_CFG
@configclass
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/joint_space_test.py#L57
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
-
+
robot = scene["robot"]
# Create controller
- diff_ik_cfg = DifferentialIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="dls")
- diff_ik_controller = DifferentialIKController(diff_ik_cfg, num_envs=scene.num_envs, device=sim.device)
+ diff_ik_cfg = DifferentialIKControllerCfg(
+ command_type="pose", use_relative_mode=False, ik_method="dls")
+ diff_ik_controller = DifferentialIKController(
+ diff_ik_cfg, num_envs=scene.num_envs, device=sim.device)
# Markers
frame_marker_cfg = FRAME_MARKER_CFG.copy()
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/joint_space_test.py#L99
[1.0, -1.712, 1.712, 0.0, 0.0, 0.0],
[0.0, 1.712, 1.712, 0.0, 0.0, 0.0],
]
- joint_position = torch.tensor(joint_position_list[joint_position_index], device=sim.device)
+ joint_position = torch.tensor(
+ joint_position_list[joint_position_index], device=sim.device)
joint_vel = robot.data.default_joint_vel.clone()
if joint_position_index >= len(joint_position_list) - 1:
joint_position_index = 0
else:
joint_position_index += 1
-
+
robot.reset()
joint_pos_des = joint_position.unsqueeze(0)[:, robot_entity_cfg.joint_ids].clone()
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/joint_space_test.py#L153
if __name__ == "__main__":
main()
- simulation_app.close()
\ No newline at end of file
+ simulation_app.close()
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L1
+from isaaclab_assets import UR10_CFG, FRANKA_PANDA_HIGH_PD_CFG
+from isaaclab.utils.math import subtract_frame_transforms
+from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
+from isaaclab.utils import configclass
+from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
+from isaaclab.markers.config import FRAME_MARKER_CFG
+from isaaclab.markers import VisualizationMarkers
+from isaaclab.managers import SceneEntityCfg
+from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg
+from isaaclab.assets import AssetBaseCfg
+import isaaclab.sim as sim_utils
+import torch
import argparse
from isaaclab.app import AppLauncher
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L9
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
-import torch
-
-import isaaclab.sim as sim_utils
-from isaaclab.assets import AssetBaseCfg
-from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg
-from isaaclab.managers import SceneEntityCfg
-from isaaclab.markers import VisualizationMarkers
-from isaaclab.markers.config import FRAME_MARKER_CFG
-from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
-from isaaclab.utils import configclass
-from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.utils.math import subtract_frame_transforms
##
# Pre-defined configs
##
-from isaaclab_assets import UR10_CFG, FRANKA_PANDA_HIGH_PD_CFG
@configclass
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L73
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
-
+
robot = scene["robot"]
# Create controller
- diff_ik_cfg = DifferentialIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="dls")
- diff_ik_controller = DifferentialIKController(diff_ik_cfg, num_envs=scene.num_envs, device=sim.device)
+ diff_ik_cfg = DifferentialIKControllerCfg(
+ command_type="pose", use_relative_mode=False, ik_method="dls")
+ diff_ik_controller = DifferentialIKController(
+ diff_ik_cfg, num_envs=scene.num_envs, device=sim.device)
# Markers
frame_marker_cfg = FRAME_MARKER_CFG.copy()
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L88
# Specify robot-specific parameters
if args_cli.robot == "franka_panda":
- robot_entity_cfg = SceneEntityCfg("robot", joint_names=["panda_joint.*"], body_names=["panda_hand"])
+ robot_entity_cfg = SceneEntityCfg(
+ "robot", joint_names=["panda_joint.*"], body_names=["panda_hand"])
elif args_cli.robot == "ur10":
robot_entity_cfg = SceneEntityCfg("robot", joint_names=[".*"], body_names=["ee_link"])
else:
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L125
while simulation_app.is_running():
# Get cube/target_point coordinates
position, quaternion = scene["cube"].get_world_poses()
- ik_commands = torch.cat([position, quaternion], dim=1) # Quaternion is in (w, x, y, z)
+ ik_commands = torch.cat([position, quaternion], dim=1) # Quaternion is in (w, x, y, z)
diff_ik_controller.set_command(ik_commands)
# obtain quantities from simulation
- jacobian = robot.root_physx_view.get_jacobians()[:, ee_jacobi_idx, :, robot_entity_cfg.joint_ids]
+ jacobian = robot.root_physx_view.get_jacobians(
+ )[:, ee_jacobi_idx, :, robot_entity_cfg.joint_ids]
ee_pose_w = robot.data.body_state_w[:, robot_entity_cfg.body_ids[0], 0:7]
root_pose_w = robot.data.root_state_w[:, 0:7]
joint_pos = robot.data.joint_pos[:, robot_entity_cfg.joint_ids]
|
|
autonomy/simulation/Wato_additional_scripts/robot_arm_controllers/task_space_test.py#L184
if __name__ == "__main__":
main()
- simulation_app.close()
\ No newline at end of file
+ simulation_app.close()
|
|
autonomy/simulation/Wato_additional_scripts/shadow_hand/shadow_hand_joint_space_test.py#L1
+from isaaclab_assets import SHADOW_HAND_CFG
+from isaaclab.utils.math import subtract_frame_transforms
+from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
+from isaaclab.utils import configclass
+from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
+from isaaclab.markers.config import FRAME_MARKER_CFG
+from isaaclab.markers import VisualizationMarkers
+from isaaclab.managers import SceneEntityCfg
+from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg
+from isaaclab.assets import AssetBaseCfg
+import isaaclab.sim as sim_utils
+import torch
import argparse
from isaaclab.app import AppLauncher
|
|
Setup Environment
Using main as the target branch
|
|
Setup Environment
Using voxel-grid as the source branch
|
|
Setup Environment
MODIFIED_MODULES are perception infrastructure
|
|
Setup Environment
Detected infrastructure changes
|
|
Confirm Build and Unit Tests Completed
All builds and unit tests completed!
|