Skip to content

Commit

Permalink
Merge pull request #4 from clubcapra/fix-env
Browse files Browse the repository at this point in the history
Fix-env
  • Loading branch information
SimonR99 authored May 18, 2024
2 parents 768263e + dcc0362 commit 281bf4d
Show file tree
Hide file tree
Showing 43 changed files with 697 additions and 1,821 deletions.
20 changes: 14 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
FROM ghcr.io/clubcapra/gazebo:harmonic
FROM ros:humble-ros-base

# Add vscode user with same UID and GID as your host system
# (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user)
ARG USERNAME=ovis
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# ENV variables
ENV ROS_DISTRO=humble
ENV GZ_VERSION=harmonic

WORKDIR /workspace/$USERNAME

RUN groupadd --gid $USER_GID $USERNAME \
RUN groupadd --gid $USER_GID $USERNAME || true \
&& groupadd -g 107 input \
&& useradd -s /bin/bash --uid $USER_UID -g $USER_GID -G 107 -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& apt-get install -y sudo tesseract-ocr \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Give user serial device permission
RUN usermod -a -G dialout $USERNAME

# Update all packages
RUN apt update && apt upgrade -y

# Install Git
RUN apt install -y git

# Copy to preload the ros packages
COPY ./ /workspace/$USERNAME/

# Change user
RUN chown $USER_UID:$USER_GID /workspace/$USERNAME
USER $USERNAME

# Copy to preload the ros packages
COPY ./ /workspace/$USERNAME/

# Rosdep update
RUN rosdep update
RUN rosdep install --from-paths src --ignore-src --rosdistro humble -y
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# ovis-ros2

Launch gazebo command:
Ovis is a 6 Degrees of Freedom (DoF) robotic arm developed by the CAPRA student club. It is designed to be highly versatile and is compatible with MoveIt for motion planning and Kinova motors for precise control. This repository provides the necessary tools and launch files to simulate and visualize the Ovis robotic arm using ROS2.


## Installation

Clone and build the repository :
```bash
git clone https://github.com/clubcapra/ovis_ros2.git
cd ovis_ros2
colcon build --symlink-install
source install/setup.bash
ros2 launch ovis_description sim.launch.py
```

Launch rviz command:
## Usage

Start the gazebo simulation :
```bash
ros2 launch ovis_bringup sim.launch.py
```

Launch gui state publisher and arm visualization :
```bash
colcon build --symlink-install
source install/setup.bash
ros2 launch ovis_description launch.py
```

Launch MoveIt! :
```bash
ros2 launch ovis_moveit demo.launch.py
```
24 changes: 0 additions & 24 deletions docs/docker_architecture_dev.puml

This file was deleted.

49 changes: 4 additions & 45 deletions docs/ros_architecture.puml
Original file line number Diff line number Diff line change
@@ -1,61 +1,20 @@
@startuml

folder "Ovis" as ovis {
[gazebo]
[hardware]
[slam]
[navigation]
[description]
[bringup]
[control]
[nlp]
}

package "Ovis control" as control {
[control.launch.py]
[teleop.launch.py]
[keyboard.launch.py]
[joy.launch.py]
}

package "Natural Language Processing" as nlp {
[capra_gpt.launch.py]
[web_server.launch.py]
[local_chat.launch.py]
}

package "Ovis hardware" as hardware {
[camera.launch.py]
[imu.launch.py]
[lidar.launch.py]
[flipper.launch.py]
[track.launch.py]
node "motor controller" as motor {
}
}

package "Ovis description" as description {
[description.launch.py]
}

package "Ovis Gazebo" as gazebo {
[sim.launch.py]
[launch.py]
}

package "Ovis Bringup" as bringup {
[ovis.launch.py]
[base.launch.py]
[top.launch.py]
}

package "Ovis Navigation" as navigation {
[nav2.launch.py]
[sim.launch.py]
}

package "Ovis SLAM" as slam {
[slam.launch.py]
[ekf.launch.py]
[slam_3d.launch.py]
package "Ovis Manipulation" as manipulation {
[moveit.launch.py]
}

@enduml
52 changes: 52 additions & 0 deletions src/ovis_bringup/launch/common.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription

from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue


def generate_launch_description():
# Get the launch directory
pkg_ovis_description = get_package_share_directory('ovis_description')
bringup_pkg_path = get_package_share_directory('ovis_bringup')

# Get the URDF file
urdf_path = os.path.join(pkg_ovis_description, 'urdf', 'ovis_standalone.urdf.xacro')
robot_desc = ParameterValue(Command(['xacro ', urdf_path]), value_type=str)

# Takes the description and joint angles as inputs and publishes
robot_state_publisher = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
name='robot_state_publisher',
output='both',
parameters=[
{'robot_description': robot_desc},
{"use_sim_time": True, }
]
)

# Visualize in RViz
rviz = Node(
package='rviz2',
executable='rviz2',
arguments=['-d', os.path.join(pkg_ovis_description, 'config',
'basic.rviz')],
)

teleop = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(bringup_pkg_path, "launch", "ovis_controller_usb.launch.py"),
),
)

return LaunchDescription([
robot_state_publisher,
rviz,
teleop,
])
38 changes: 0 additions & 38 deletions src/ovis_bringup/launch/rove_controller_bluethoot.launch.py

This file was deleted.

71 changes: 71 additions & 0 deletions src/ovis_bringup/launch/sim.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription

from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue
from launch.actions import DeclareLaunchArgument


def generate_launch_description():
# Configure ROS nodes for launch

# Get the launch directory
pkg_ovis_bringup = get_package_share_directory('ovis_bringup')
pkg_ovis_description = get_package_share_directory('ovis_description')
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')

# Get the URDF file
world_file_name = 'worlds/base_world.world'
world = os.path.join(pkg_ovis_description, world_file_name)

# Setup to launch the simulator and Gazebo world
gz_sim = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py')),
launch_arguments={'gz_args': "-v 4 -r " + world}.items(),
)

# Spawn robot
create = Node(
package='ros_gz_sim',
executable='create',
arguments=['-name', 'ovis',
'-topic', 'robot_description',
'-x', '0',
'-y', '0',
'-z', '0.1',
],
output='screen',
)

# Bridge ROS topics and Gazebo messages for establishing communication
bridge = Node(
package='ros_gz_bridge',
executable='parameter_bridge',
parameters=[{
'config_file': os.path.join(pkg_ovis_description, 'config',
'default_bridge.yaml'),
'qos_overrides./tf_static.publisher.durability': 'transient_local',
"use_sim_time": True,
}],
output='screen'
)

# Include common launch configuration
common = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ovis_bringup, "launch", "common.launch.py"),
),
)

return LaunchDescription([
gz_sim,
bridge,
create,
common,
])
41 changes: 0 additions & 41 deletions src/ovis_description/config/amazon_bridge.yaml

This file was deleted.

Loading

0 comments on commit 281bf4d

Please sign in to comment.