diff --git a/README.md b/README.md index 939808e..0423970 100644 --- a/README.md +++ b/README.md @@ -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) - - - - -

@@ -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) @@ -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 <= | @@ -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 ``` diff --git a/README_JA.md b/README_JA.md index d2c63bd..999d141 100644 --- a/README_JA.md +++ b/README_JA.md @@ -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) - - - - -

- + @@ -30,8 +25,8 @@ 3. [**インストール**](#インストール) 1. [リポジトリのクローン](#リポジトリのクローン) - 2. [依存関係のインストール](#依存関係のインストール) - 3. [アセットのダウンロード](#アセットのダウンロード) + 2. [アセットのダウンロードと依存パッケージのインストール](#アセットのダウンロードと依存パッケージのインストール) + 4. [**使い方**](#使い方) 1. [ビルド & ソース](#ビルド--ソース) @@ -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 <= | @@ -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 ``` @@ -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] diff --git a/install_local.sh b/install_local.sh index 6a0350b..b26d53c 100755 --- a/install_local.sh +++ b/install_local.sh @@ -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..." @@ -37,16 +40,14 @@ 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 || \ @@ -54,8 +55,8 @@ echo "deb https://isaac.download.nvidia.com/isaac-ros/release-3 $(lsb_release -c 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 @@ -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!" diff --git a/int-ball2_control/launch/int-ball2_teleop.launch.py b/int-ball2_control/launch/int-ball2_teleop.launch.py index 60f1113..577d62a 100644 --- a/int-ball2_control/launch/int-ball2_teleop.launch.py +++ b/int-ball2_control/launch/int-ball2_teleop.launch.py @@ -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([ diff --git a/int-ball2_control/scripts/direct_effort_control.py b/int-ball2_control/scripts/direct_effort_control.py index 8908e12..f3aca7e 100755 --- a/int-ball2_control/scripts/direct_effort_control.py +++ b/int-ball2_control/scripts/direct_effort_control.py @@ -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): @@ -22,7 +22,7 @@ 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") @@ -30,30 +30,31 @@ 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): diff --git a/int-ball2_control/scripts/direct_velocity_control.py b/int-ball2_control/scripts/direct_velocity_control.py index 750c5b0..f8b826b 100755 --- a/int-ball2_control/scripts/direct_velocity_control.py +++ b/int-ball2_control/scripts/direct_velocity_control.py @@ -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})" ) diff --git a/int-ball2_data_replay/CMakeLists.txt b/int-ball2_data_replay/CMakeLists.txt index c8d8502..d244ea5 100644 --- a/int-ball2_data_replay/CMakeLists.txt +++ b/int-ball2_data_replay/CMakeLists.txt @@ -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 +) diff --git a/int-ball2_isaac_sim/launch/int-ball2_isaac_sim.launch.py b/int-ball2_isaac_sim/launch/int-ball2_isaac_sim.launch.py index a9dddd5..54be2fd 100755 --- a/int-ball2_isaac_sim/launch/int-ball2_isaac_sim.launch.py +++ b/int-ball2_isaac_sim/launch/int-ball2_isaac_sim.launch.py @@ -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 @@ -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') ]) @@ -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() )