Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
54b727f
initial implementation of pointcloud filtering and segmentation
alexlin2 May 14, 2025
94487cb
small bug fix
alexlin2 May 14, 2025
07acf38
added basic RANSAC plane remove algorithm
alexlin2 May 20, 2025
1ad4229
refactored and cleanup pointcloud filtering
alexlin2 Jun 2, 2025
cad5330
CI code cleanup
alexlin2 Jun 2, 2025
54b6a6f
cleanup pointcloud filtering
alexlin2 Jun 3, 2025
b7575d4
added grasp generation to pipeline
alexlin2 Jun 6, 2025
42840dd
I'm so f**ing tired after this
alexlin2 Jun 6, 2025
d65932a
added SAM2 support for segmentation, added manipulation perception pr…
alexlin2 Jun 17, 2025
6a16523
CI code cleanup
alexlin2 Jun 17, 2025
1dbc232
supports contact graspnet
alexlin2 Jun 25, 2025
0b03fd9
added parsing of contact graspnet results into dict
alexlin2 Jun 25, 2025
4d29bc3
added anygrasp and contact graspnet support
alexlin2 Jun 26, 2025
4ed8ab1
zed frames saving
alexlin2 Jun 26, 2025
6665b28
zed driver changes, saving 3d pointcloud
alexlin2 Jun 26, 2025
e554fca
fixes
alexlin2 Jul 9, 2025
b7c7a57
first commit
alexlin2 Jul 10, 2025
5c86643
PBVS fully working in the correct coordinate frame
alexlin2 Jul 12, 2025
856acad
added piper arm wrapper
rapmusta Jul 13, 2025
8774e0e
CI code cleanup
mustafab0 Jul 13, 2025
62a0320
added can init support and soft stopping to avoid crashes when quiting
mustafab0 Jul 14, 2025
4ca7cbd
CI code cleanup
mustafab0 Jul 14, 2025
a8a47c4
addded velocity controller and urdf file
mustafab0 Jul 15, 2025
82a7a11
added velocity controller with end pose ctrl
mustafab0 Jul 15, 2025
3b08d13
added dt to the loop
mustafab0 Jul 15, 2025
157ed2f
initial implementation of pointcloud filtering and segmentation
alexlin2 May 14, 2025
d89efb8
small bug fix
alexlin2 May 14, 2025
1b77341
added basic RANSAC plane remove algorithm
alexlin2 May 20, 2025
dae60e8
refactored and cleanup pointcloud filtering
alexlin2 Jun 2, 2025
da1bc67
CI code cleanup
alexlin2 Jun 2, 2025
96e5e09
cleanup pointcloud filtering
alexlin2 Jun 3, 2025
32581e7
added an all-in-one manipulation pipeline that goes from stereo -> la…
alexlin2 Jun 5, 2025
9966296
added grasp generation to pipeline
alexlin2 Jun 6, 2025
c140b07
I'm so f**ing tired after this
alexlin2 Jun 6, 2025
474e442
added SAM2 support for segmentation, added manipulation perception pr…
alexlin2 Jun 17, 2025
2981926
CI code cleanup
alexlin2 Jun 17, 2025
0f6632e
added misc points clustering
alexlin2 Jun 19, 2025
bd5176f
CI code cleanup
alexlin2 Jun 19, 2025
4e34d65
added open3d's voxelgrid to manip_output
alexlin2 Jun 20, 2025
304dcc2
CI code cleanup
alexlin2 Jun 20, 2025
a26d7a4
supports contact graspnet
alexlin2 Jun 25, 2025
6575e0e
added parsing of contact graspnet results into dict
alexlin2 Jun 25, 2025
db37462
refactored some code, fixed a few bugs
alexlin2 Jun 26, 2025
4f5bbf5
added anygrasp and contact graspnet support
alexlin2 Jun 26, 2025
e54306e
removed all contactgraspnet stuff
alexlin2 Jun 26, 2025
653bc35
zed frames saving
alexlin2 Jun 26, 2025
0599c19
fixes
alexlin2 Jul 9, 2025
d1b96c1
first commit
alexlin2 Jul 10, 2025
4d64e55
CI code cleanup
mustafab0 Jul 15, 2025
c4493f2
CI code cleanup
mustafab0 Jul 15, 2025
6ac4da1
CI code cleanup
mustafab0 Jul 15, 2025
6a760fa
fixed frame transform
alexlin2 Jul 15, 2025
fa41361
feature: PBVS fully working using ZED as origin
alexlin2 Jul 15, 2025
0f5a214
refactored transform function into transform utils
alexlin2 Jul 16, 2025
9c73136
Use Scipy for Quaternion to Euler
alexlin2 Jul 16, 2025
b0e41fd
switched to using LCM Pose and scipy for pose transforms
alexlin2 Jul 16, 2025
bb32bb4
CI code cleanup
alexlin2 Jul 16, 2025
8a54752
added timeout to controller
mustafab0 Jul 16, 2025
31cb901
CI code cleanup
mustafab0 Jul 16, 2025
39ba624
visual servoing fully working
alexlin2 Jul 17, 2025
cc0bf7b
CI code cleanup
alexlin2 Jul 17, 2025
cebc383
grasp working
alexlin2 Jul 17, 2025
2b9a02e
CI code cleanup
alexlin2 Jul 17, 2025
eb733fc
works really well, keeping a checkpoint
alexlin2 Jul 17, 2025
cb9fc5f
changed all visual servoing to use LCM types
alexlin2 Jul 18, 2025
3e0cd6c
CI code cleanup
alexlin2 Jul 18, 2025
5441bf1
cleanup
alexlin2 Jul 18, 2025
bebc9fa
remove build directory
alexlin2 Jul 18, 2025
1e8da3f
use piper from ours
alexlin2 Jul 18, 2025
b1804a3
removed submodule
alexlin2 Jul 19, 2025
d1199b3
switch to using lcm types for transform utils
alexlin2 Jul 19, 2025
e29b563
Perfected state machine, cleaned everything up
alexlin2 Jul 21, 2025
61b7cb9
further cleanup
alexlin2 Jul 21, 2025
d51e58d
fixed bugs, refactoring
alexlin2 Jul 22, 2025
c43bd53
more cleanup
alexlin2 Jul 22, 2025
b3484b6
turned ZED into a module and simplified the visualization logic
alexlin2 Jul 23, 2025
42b634c
pick and place as module fully working
alexlin2 Jul 23, 2025
a58c6c5
fully implemented place in pick and place, cleaned up significantly
alexlin2 Jul 23, 2025
6da0956
major refactor, added dynamic grasp angle
alexlin2 Jul 24, 2025
9adb80a
hacky bug fix
alexlin2 Jul 24, 2025
fe3c785
Feat: fully working piper arm manipulation robot
alexlin2 Jul 25, 2025
31860e1
bug fix, increased failure tolerance time
alexlin2 Jul 25, 2025
9a31c8f
fixed most of Stash's comments
alexlin2 Jul 25, 2025
e5abd8b
Added gpu pytest tag to addopts
spomichter Jul 25, 2025
691b64e
added chinese readme
alexlin2 Jul 26, 2025
e11a96d
removed submodule
alexlin2 Jul 26, 2025
43a32e6
added piper-sdk to manipulation requirements
alexlin2 Jul 26, 2025
09377c0
undo addition to gitignore, also finally fixed bgr video
alexlin2 Jul 27, 2025
a8e2053
put back init.py, relaxed frontier exploration filter conditions
alexlin2 Jul 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions dimos/hardware/can_activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash

# The default CAN name can be set by the user via command-line parameters.
DEFAULT_CAN_NAME="${1:-can0}"

# The default bitrate for a single CAN module can be set by the user via command-line parameters.
DEFAULT_BITRATE="${2:-1000000}"

# USB hardware address (optional parameter)
USB_ADDRESS="${3}"
echo "-------------------START-----------------------"
# Check if ethtool is installed.
if ! dpkg -l | grep -q "ethtool"; then
echo "\e[31mError: ethtool not detected in the system.\e[0m"
echo "Please use the following command to install ethtool:"
echo "sudo apt update && sudo apt install ethtool"
exit 1
fi

# Check if can-utils is installed.
if ! dpkg -l | grep -q "can-utils"; then
echo "\e[31mError: can-utils not detected in the system.\e[0m"
echo "Please use the following command to install ethtool:"
echo "sudo apt update && sudo apt install can-utils"
exit 1
fi

echo "Both ethtool and can-utils are installed."

# Retrieve the number of CAN modules in the current system.
CURRENT_CAN_COUNT=$(ip link show type can | grep -c "link/can")

# Verify if the number of CAN modules in the current system matches the expected value.
if [ "$CURRENT_CAN_COUNT" -ne "1" ]; then
if [ -z "$USB_ADDRESS" ]; then
# Iterate through all CAN interfaces.
for iface in $(ip -br link show type can | awk '{print $1}'); do
# Use ethtool to retrieve bus-info.
BUS_INFO=$(sudo ethtool -i "$iface" | grep "bus-info" | awk '{print $2}')

if [ -z "$BUS_INFO" ];then
echo "Error: Unable to retrieve bus-info for interface $iface."
continue
fi

echo "Interface $iface is inserted into USB port $BUS_INFO"
done
echo -e " \e[31m Error: The number of CAN modules detected by the system ($CURRENT_CAN_COUNT) does not match the expected number (1). \e[0m"
echo -e " \e[31m Please add the USB hardware address parameter, such as: \e[0m"
echo -e " bash can_activate.sh can0 1000000 1-2:1.0"
echo "-------------------ERROR-----------------------"
exit 1
fi
fi

# Load the gs_usb module.
# sudo modprobe gs_usb
# if [ $? -ne 0 ]; then
# echo "Error: Unable to load the gs_usb module."
# exit 1
# fi

if [ -n "$USB_ADDRESS" ]; then
echo "Detected USB hardware address parameter: $USB_ADDRESS"

# Use ethtool to find the CAN interface corresponding to the USB hardware address.
INTERFACE_NAME=""
for iface in $(ip -br link show type can | awk '{print $1}'); do
BUS_INFO=$(sudo ethtool -i "$iface" | grep "bus-info" | awk '{print $2}')
if [ "$BUS_INFO" = "$USB_ADDRESS" ]; then
INTERFACE_NAME="$iface"
break
fi
done

if [ -z "$INTERFACE_NAME" ]; then
echo "Error: Unable to find CAN interface corresponding to USB hardware address $USB_ADDRESS."
exit 1
else
echo "Found the interface corresponding to USB hardware address $USB_ADDRESS: $INTERFACE_NAME."
fi
else
# Retrieve the unique CAN interface.
INTERFACE_NAME=$(ip -br link show type can | awk '{print $1}')

# Check if the interface name has been retrieved.
if [ -z "$INTERFACE_NAME" ]; then
echo "Error: Unable to detect CAN interface."
exit 1
fi
BUS_INFO=$(sudo ethtool -i "$INTERFACE_NAME" | grep "bus-info" | awk '{print $2}')
echo "Expected to configure a single CAN module, detected interface $INTERFACE_NAME with corresponding USB address $BUS_INFO."
fi

# Check if the current interface is already activated.
IS_LINK_UP=$(ip link show "$INTERFACE_NAME" | grep -q "UP" && echo "yes" || echo "no")

# Retrieve the bitrate of the current interface.
CURRENT_BITRATE=$(ip -details link show "$INTERFACE_NAME" | grep -oP 'bitrate \K\d+')

if [ "$IS_LINK_UP" = "yes" ] && [ "$CURRENT_BITRATE" -eq "$DEFAULT_BITRATE" ]; then
echo "Interface $INTERFACE_NAME is already activated with a bitrate of $DEFAULT_BITRATE."

# Check if the interface name matches the default name.
if [ "$INTERFACE_NAME" != "$DEFAULT_CAN_NAME" ]; then
echo "Rename interface $INTERFACE_NAME to $DEFAULT_CAN_NAME."
sudo ip link set "$INTERFACE_NAME" down
sudo ip link set "$INTERFACE_NAME" name "$DEFAULT_CAN_NAME"
sudo ip link set "$DEFAULT_CAN_NAME" up
echo "The interface has been renamed to $DEFAULT_CAN_NAME and reactivated."
else
echo "The interface name is already $DEFAULT_CAN_NAME."
fi
else
# If the interface is not activated or the bitrate is different, configure it.
if [ "$IS_LINK_UP" = "yes" ]; then
echo "Interface $INTERFACE_NAME is already activated, but the bitrate is $CURRENT_BITRATE, which does not match the set value of $DEFAULT_BITRATE."
else
echo "Interface $INTERFACE_NAME is not activated or bitrate is not set."
fi

# Set the interface bitrate and activate it.
sudo ip link set "$INTERFACE_NAME" down
sudo ip link set "$INTERFACE_NAME" type can bitrate $DEFAULT_BITRATE
sudo ip link set "$INTERFACE_NAME" up
echo "Interface $INTERFACE_NAME has been reset to bitrate $DEFAULT_BITRATE and activated."

# Rename the interface to the default name.
if [ "$INTERFACE_NAME" != "$DEFAULT_CAN_NAME" ]; then
echo "Rename interface $INTERFACE_NAME to $DEFAULT_CAN_NAME."
sudo ip link set "$INTERFACE_NAME" down
sudo ip link set "$INTERFACE_NAME" name "$DEFAULT_CAN_NAME"
sudo ip link set "$DEFAULT_CAN_NAME" up
echo "The interface has been renamed to $DEFAULT_CAN_NAME and reactivated."
fi
fi

echo "-------------------OVER------------------------"
Loading
Loading