Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
![GitHub fork](https://img.shields.io/github/forks/sd-robotics/int-ball2_isaac_sim)
![GitHub stars](https://img.shields.io/github/stars/sd-robotics/int-ball2_isaac_sim)

<!-- [![Ubuntu22.04](https://img.shields.io/badge/Ubuntu-22.04-orange.svg)](https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview) -->
<!-- [![IsaacSim](https://img.shields.io/badge/IsaacSim-4.2.0-green.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) -->
<!-- [![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html) -->
<!-- [![ros2-humble installation](https://img.shields.io/badge/ROS2-Humble-blue.svg)](https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html) -->

<p style="display: inline">
<img src="https://img.shields.io/badge/-Ubuntu_22.04_LTS-555555.svg?style=flat&logo=ubuntu">
<img src="https://img.shields.io/badge/-Isaac_Sim 4.5.0-76B900.svg?style=flat&logo=nvidia&logoColor=white">
Expand All @@ -30,8 +25,7 @@

3. [**Installation**](#installation)
1. [Clone Repository](#clone-repository)
2. [Install Dependencies](#install-dependencies)
3. [Download Assets](#download-assets)
2. [Download Assets and Install Dependencies](#download-assets-and-install-dependencies)

4. [**Usage**](#usage)
1. [Build & Source](#build--source)
Expand Down Expand Up @@ -62,7 +56,7 @@ In order to use this project, you need to get ready the following environment.
| Package | Version |
| --------- | ----------------------- |
| Ubuntu | 22.04 (Jammy Jellyfish) |
| Isaac Sim | 4.2.0 (September 2024) |
| Isaac Sim | 4.5.0 |
| ROS | Humble Hawksbill |
| Python | 3.10 <= |

Expand All @@ -79,24 +73,13 @@ Clone this package into your workspace.
git clone https://github.com/sd-robotics/int-ball2_isaac_sim.git
```

### Install Dependencies
Move into your workspace.
```bash
cd ~/int-ball2_ws/
```

Install the dependencies.
``` bash
rosdep install --from-paths src --ignore-src -r -y
```

### Download Assets
### Download Assets and Install Dependencies
Move into this project folder.
```bash
cd ~/int-ball2_ws/src/int-ball2_isaac_sim
```

Download the assets (Int-Ball2, JEM, etc).
Download the assets (Int-Ball2, JEM, etc) and install software dependencies.
```bash
bash install_local.sh
```
Expand Down
30 changes: 8 additions & 22 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@
![GitHub fork](https://img.shields.io/github/forks/sd-robotics/int-ball2_isaac_sim)
![GitHub stars](https://img.shields.io/github/stars/sd-robotics/int-ball2_isaac_sim)

<!-- [![Ubuntu22.04](https://img.shields.io/badge/Ubuntu-22.04-orange.svg)](https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview) -->
<!-- [![IsaacSim](https://img.shields.io/badge/IsaacSim-4.2.0-green.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) -->
<!-- [![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html) -->
<!-- [![ros2-humble installation](https://img.shields.io/badge/ROS2-Humble-blue.svg)](https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html) -->

<p style="display: inline">
<img src="https://img.shields.io/badge/-Ubuntu_22.04_LTS-555555.svg?style=flat&logo=ubuntu">
<img src="https://img.shields.io/badge/-Isaac_Sim 4.2.0-76B900.svg?style=flat&logo=nvidia&logoColor=white">
<img src="https://img.shields.io/badge/-Isaac_Sim 4.5.0-76B900.svg?style=flat&logo=nvidia&logoColor=white">
<img src="https://img.shields.io/badge/-ROS2 Humble-%2322314E?style=flat&logo=ROS&logoColor=white">
<img src="https://img.shields.io/badge/-Python 3.10-3776AB.svg?logo=python&style=flat&logoColor=white">
<img src="https://img.shields.io/badge/License-Apache--2.0-60C060.svg?style=flat">
Expand All @@ -30,8 +25,8 @@

3. [**インストール**](#インストール)
1. [リポジトリのクローン](#リポジトリのクローン)
2. [依存関係のインストール](#依存関係のインストール)
3. [アセットのダウンロード](#アセットのダウンロード)
2. [アセットのダウンロードと依存パッケージのインストール](#アセットのダウンロードと依存パッケージのインストール)


4. [**使い方**](#使い方)
1. [ビルド & ソース](#ビルド--ソース)
Expand Down Expand Up @@ -63,7 +58,7 @@ ISS/JEM環境におけるInt-Ball2の挙動を、ユーザー開発プログラ
| Package | Version |
| --------- | ----------------------- |
| Ubuntu | 22.04 (Jammy Jellyfish) |
| Isaac Sim | 4.2.0 (September 2024) |
| Isaac Sim | 4.5.0 |
| ROS | Humble Hawksbill |
| Python | 3.10 <= |

Expand All @@ -80,24 +75,15 @@ cd ~/int-ball2_ws/src
git clone https://github.com/sd-robotics/int-ball2_isaac_sim.git
```

### 依存関係のインストール
ワークスペースまで移動します。
```bash
cd ~/int-ball2_ws/
```
### アセットのダウンロードと依存パッケージのインストール

依存関係をインストールします。
``` bash
rosdep install --from-paths src --ignore-src -r -y
```

### アセットのダウンロード
プロジェクトまで移動します。
```bash
cd ~/int-ball2_ws/src/int-ball2_isaac_sim
```

アセットをダウンロードします(Int-Ball2、JEM等)。
アセットをダウンロードと依存パッケージのインストールを行います。

```bash
bash install_local.sh
```
Expand All @@ -114,7 +100,7 @@ source install/setup.bash
### シミュレータの起動方法
ros2 launchでシミュレータを起動します。
```bash
ros2 launch int-ball2_isaac_sim int-ball2_isaac_sim.launch.py gui:="~/int-ball2_ws/src/int-ball2_isaac_sim/assets/KIBOU.usd"
ros2 launch ib2_isaac_sim int-ball2_isaac_sim.launch.py usd_file:="KIBOU.usd"
```

> [!NOTE]
Expand Down
23 changes: 13 additions & 10 deletions install_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ if ! command -v gdown &> /dev/null; then
exit 1
fi

CRT_DIR=$(pwd)
cd int-ball2_isaac_sim
PKG_DIR=$(pwd) # .../intball2_ws/src/int-ball2_isaac_sim
SRC_DIR=$(dirname "$PKG_DIR") # .../intball2_ws/src
WS_DIR=$(realpath "$SRC_DIR/..") # .../intball2_ws

cd "$PKG_DIR"

# Download the folder as a ZIP file
echo "Starting download of assets..."
Expand All @@ -37,25 +40,23 @@ unzip -qq assets.zip
rm assets.zip
echo "Download complete!"

cd "$CRT_DIR"

# Clone ib2 interface repository
cd "$SRC_DIR"
if [ ! -d "ib2_interfaces" ]; then
git clone git@github.com:sd-robotics/ib2_interfaces.git
git clone https://github.com/sd-robotics/ib2_interfaces.git
else
echo "ib2_interfaces directory already exists, skipping clone."
fi


# Install Isaac Sim dependencies
wget -qO - https://isaac.download.nvidia.com/isaac-ros/repos.key | sudo apt-key add -
grep -qxF "deb https://isaac.download.nvidia.com/isaac-ros/release-3 $(lsb_release -cs) release-3.0" /etc/apt/sources.list || \
echo "deb https://isaac.download.nvidia.com/isaac-ros/release-3 $(lsb_release -cs) release-3.0" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y ros-humble-isaac-ros-nitros

# Setup Isaac Sim launcher repository
cd ..
# Setup Isaac Sim launcher repository under src
cd "$SRC_DIR"
if [ ! -d "IsaacSim-ros_workspaces" ]; then
mkdir IsaacSim-ros_workspaces
cd IsaacSim-ros_workspaces
Expand All @@ -64,11 +65,13 @@ if [ ! -d "IsaacSim-ros_workspaces" ]; then
git config core.sparseCheckout true
git sparse-checkout set humble_ws/src/isaacsim
git pull origin main
cd "$CRT_DIR"
else
echo "IsaacSim-ros_workspaces directory already exists, skipping clone."
cd "$CRT_DIR"
fi

# rosdep dependencies
echo "Install ros2 packages dependencies"
cd "$WS_DIR"
rosdep install --from-paths "$SRC_DIR" --ignore-src -r -y

echo "Local installation complete!"
10 changes: 8 additions & 2 deletions int-ball2_control/launch/int-ball2_teleop.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ def generate_launch_description():
package = 'int-ball2_control',
executable = 'direct_velocity_control.py',
name = 'ib2_vel_ctrl',
output = 'screen'
output = 'screen',
parameters=[{
'use_sim_time': True
}]
)

intball2_effort_joy_node = Node(
package = 'int-ball2_control',
executable = 'direct_effort_control.py',
name = 'ib2_eff_ctrl',
output = 'screen'
output = 'screen',
parameters=[{
'use_sim_time': True
}]
)

return LaunchDescription([
Expand Down
27 changes: 14 additions & 13 deletions int-ball2_control/scripts/direct_effort_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Wrench
from geometry_msgs.msg import WrenchStamped

class IntBall2ForceController(Node):
def __init__(self):
Expand All @@ -22,38 +22,39 @@ def __init__(self):
)

# Publisher for force/torque
self.wrench_publisher = self.create_publisher(Wrench, "/ctl/wrench", 10)
self.wrench_publisher = self.create_publisher(WrenchStamped, "/ctl/wrench", 10)

self.get_logger().info("Int-Ball2 Force Controller Node Initialized")

def joy_callback(self, msg):
"""
Callback for handling joystick inputs and mapping them to Wrench messages.
"""
wrench = Wrench()
wrench_st = WrenchStamped()
wrench_st.header.stamp = self.get_clock().now().to_msg()

# Left stick controls force in X and Y
wrench.force.x = msg.axes[1] * self.force_scale # Left stick X
wrench.force.y = msg.axes[0] * self.force_scale # Left stick Y
wrench_st.wrench.force.x = msg.axes[1] * self.force_scale # Left stick X
wrench_st.wrench.force.y = msg.axes[0] * self.force_scale # Left stick Y

# Right stick controls rotation (torque) in X and Y
wrench.torque.x = msg.axes[4] * self.torque_scale # Right stick X
wrench.torque.y = msg.axes[3] * self.torque_scale # Right stick Y
wrench_st.wrench.torque.x = msg.axes[4] * self.torque_scale # Right stick X
wrench_st.wrench.torque.y = msg.axes[3] * self.torque_scale # Right stick Y

# L2 (Axis 2) and R2 (Axis 5) control force in Z
L2 = (1 - msg.axes[2]) / 2 # Convert from [-1, 1] to [0, 1]
R2 = (1 - msg.axes[5]) / 2 # Convert from [-1, 1] to [0, 1]

if msg.buttons[1]:
wrench.force.z = (R2 - L2) * self.force_scale # R2 increases, L2 decreases
wrench_st.wrench.force.z = (R2 - L2) * self.force_scale # R2 increases, L2 decreases
elif msg.buttons[0]:
wrench.torque.z = (R2 - L2) * self.torque_scale # R2 increases, L2 decreases
wrench_st.wrench.torque.z = (R2 - L2) * self.torque_scale # R2 increases, L2 decreases

# Publish the wrench message
self.wrench_publisher.publish(wrench)
self.get_logger().info(
f"Published wrench: Force({wrench.force.x}, {wrench.force.y}, {wrench.force.z}) | "
f"Torque({wrench.torque.x}, {wrench.torque.y}, {wrench.torque.z})"
self.wrench_publisher.publish(wrench_st)
self.get_logger().debug(
f"Published wrench: Force({wrench_st.wrench.force.x}, {wrench_st.wrench.force.y}, {wrench_st.wrench.force.z}) | "
f"Torque({wrench_st.wrench.torque.x}, {wrench_st.wrench.torque.y}, {wrench_st.wrench.torque.z})"
)

def main(args=None):
Expand Down
18 changes: 9 additions & 9 deletions int-ball2_control/scripts/direct_velocity_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ def joy_callback(self, joy_msg):
twist = Twist()

# Left stick controls linear velocity in X and Y
twist.linear.x = msg.axes[1] * self.MAX_LIN_VEL # Left stick X
twist.linear.y = msg.axes[0] * self.MAX_LIN_VEL # Left stick Y
twist.linear.x = joy_msg.axes[1] * self.MAX_LIN_VEL # Left stick X
twist.linear.y = joy_msg.axes[0] * self.MAX_LIN_VEL # Left stick Y

# Right stick controls angular velocity in X and Y
twist.angular.x = msg.axes[4] * self.MAX_ANG_VEL # Right stick X
twist.angular.y = msg.axes[3] * self.MAX_ANG_VEL # Right stick Y
twist.angular.x = joy_msg.axes[4] * self.MAX_ANG_VEL # Right stick X
twist.angular.y = joy_msg.axes[3] * self.MAX_ANG_VEL # Right stick Y

# L2 (Axis 2) and R2 (Axis 5) control force in Z
L2 = (1 - msg.axes[2]) / 2 # Convert from [-1, 1] to [0, 1]
R2 = (1 - msg.axes[5]) / 2 # Convert from [-1, 1] to [0, 1]
L2 = (1 - joy_msg.axes[2]) / 2 # Convert from [-1, 1] to [0, 1]
R2 = (1 - joy_msg.axes[5]) / 2 # Convert from [-1, 1] to [0, 1]

if msg.buttons[1]:
if joy_msg.buttons[1]:
twist.linear.z = (R2 - L2) * self.MAX_LIN_VEL # R2 increases, L2 decreases
elif msg.buttons[0]:
elif joy_msg.buttons[0]:
twist.angular.z = (R2 - L2) * self.MAX_ANG_VEL # R2 increases, L2 decreases

# Publish the twist message
self.twist_publisher.publish(twist)
self.get_logger().info(
self.get_logger().debug(
f"Published Twist: Linear({twist.linear.x}, {twist.linear.y}, {twist.linear.z}) | "
f"Angular({twist.angular.x}, {twist.angular.y}, {twist.angular.z})"
)
Expand Down
4 changes: 3 additions & 1 deletion int-ball2_data_replay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package()
ament_auto_package(
USE_SCOPED_HEADER_INSTALL_DIR
)
28 changes: 26 additions & 2 deletions int-ball2_isaac_sim/launch/int-ball2_isaac_sim.launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, SetEnvironmentVariable
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, TextSubstitution
from launch_ros.substitutions import FindPackageShare
Expand Down Expand Up @@ -27,10 +27,31 @@ def generate_launch_description():
default_value='false',
description='Play Isaac Sim after the scene is loaded'
),
# Forwarded args to upstream run_isaacsim.launch.py to ensure correct ROS setup
DeclareLaunchArgument(
'use_internal_libs',
default_value='false',
description='Use ROS libraries shipped with Isaac Sim to avoid host ROS conflicts'
),
DeclareLaunchArgument(
'dds_type',
default_value='fastdds',
description='DDS implementation for Isaac Sim ROS bridge (fastdds or cyclonedds)'
),
DeclareLaunchArgument(
'ros_distro',
default_value='humble',
description='ROS distribution to use inside Isaac Sim'
),
DeclareLaunchArgument(
'exclude_install_path',
default_value='',
description='Comma-separated install paths to exclude from Isaac Sim environment (e.g., /opt/ros/humble,~/ws/install)'
),
]

asset_path = PathJoinSubstitution([
FindPackageShare('int-ball2_isaac_sim'),
FindPackageShare('ib2_isaac_sim'),
'assets',
LaunchConfiguration('usd_file')
])
Expand All @@ -48,6 +69,9 @@ def generate_launch_description():
'install_path': LaunchConfiguration('isaac_path'),
'gui': asset_path,
'play_sim_on_start': LaunchConfiguration('play_on_start'),
'use_internal_libs': LaunchConfiguration('use_internal_libs'),
'dds_type': LaunchConfiguration('dds_type'),
'ros_distro': LaunchConfiguration('ros_distro'),
}.items()
)

Expand Down