Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .github/workflows/ros-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
echo ${skip_packages}
fi
done
else
# if amd, then clone the mirte_gazebo repo, otherwise skip it, arm doesnt have gazebo compiled (yet)
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
git clone https://github.com/mirte-robot/mirte-gazebo.git ./srcO/mirte_gazebo
fi
fi
# always skip generate_parameter_library example packages
skip_packages+=" generate_parameter_library_example cmake_generate_parameter_module_example generate_parameter_library_example_external generate_parameter_module_example"
Expand Down
2 changes: 1 addition & 1 deletion mirte_telemetrix_cpp/libs/tmx-cpp
4 changes: 3 additions & 1 deletion mirte_teleop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ find_package(ament_cmake REQUIRED)
# manually. find_package(<dependency> REQUIRED)

install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})

install(PROGRAMS
scripts/mirte_master_arm.py
DESTINATION lib/${PROJECT_NAME} )
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights comment the
Expand Down
80 changes: 80 additions & 0 deletions mirte_teleop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Mirte teleop

Sample teleoperation launch and scripts for MIRTE pioneer and master.


## Teleop Key:
This is an ugly hack to get input from the user, the launch file doesn't actually launch. Don't include this one in other launch files!


## Teleop joy mm arm:
Default settings are for an PS4 controller directly connected to the robot.
Change includes to use xbox controller (probably)
- drive:
- left stick for forward and rotate
- arrow buttons for move left right
- need to hold L1 for it to move.
- Arm:
- right stick to move the arm.
- Rotation is left-right
- Up down is done with up down of the stick. If the shoulder_lift servo is at the lowest position, the elbow and wrist start to move.
- Open gripper with X, close with O.
- Shutdown robot with options button for 2 seconds.

## Teleop joy ps4:
PS4 controller works differently internally (/dev/jsX) than before, so joy-linux is required to read those inputs.
Uses L1 (left button) as enable for cmd_vel.


## Mirte master arm script:
Controls the arm as described above (mm arm).



# Connecting bluetooth controller directly to robot
Make sure that bluez, teleop-twist-joy, joy and joy-linux are installed on the robot:
```bash
sudo apt install bluez bluetooth ros-humble-teleop-twist-joy ros-humble-joy ros-humble-joy-linux
```

Connect bluetooth controller:
```bash
sudo bluetoothctl
scan on
# hold and press share and PS button till fast blink
# find MAC of controller:
devices
pair <MAC>
connect <MAC>
trust <MAC>
exit
```
The controller should now have a blue bar and there should be a `/dev/js0` file.


Sometimes you'll need to restart the bluetooth service after it to auto-connect and show up as `/dev/jsX`

```bash
sudo systemctl restart bluetooth.service
```



## Autostart on boot
Add
```python
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[
PathJoinSubstitution(
[
FindPackageShare("mirte_teleop"),
"launch",
"teleop_joy_mm_arm.launch.py",
]
)
]
)
)
```
to `src/mirte-ros-packages/mirte_bringup/launch/minimal_master.launch.py`, line 300.
18 changes: 12 additions & 6 deletions mirte_teleop/launch/teleop_joy.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
def generate_launch_description():
return LaunchDescription(
[
# Node(
# package="joy",
# executable="joy_node",
# name="joy_node",
# parameters=[
# {"dev": "/dev/input/js0", "deadzone": 0.1, "autorepeat_rate": 20.0}
# ],
# ),
Node(
package="joy",
executable="joy_node",
name="joy_node",
parameters=[
{"dev": "/dev/input/js0", "deadzone": 0.1, "autorepeat_rate": 20.0}
],
package="joy_linux",
executable="joy_linux_node",
name="joy_linux_node",
parameters=[{"deadzone": 0.1, "autorepeat_rate": 20.0}],
),
Node(
package="teleop_twist_joy",
Expand Down
29 changes: 29 additions & 0 deletions mirte_teleop/launch/teleop_joy_mm_arm.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from launch import LaunchDescription
from launch_ros.actions import Node
import os
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory


# works for ps4 controller
# if other controller, maybe change the included launch file to teleop_joy.launch.py
def generate_launch_description():
return LaunchDescription(
[
Node(
package="mirte_teleop",
executable="mirte_master_arm.py",
name="mirte_master_arm",
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(
get_package_share_directory("mirte_teleop"),
"launch",
"teleop_joy_ps4.launch.py",
)
)
),
]
)
42 changes: 42 additions & 0 deletions mirte_teleop/launch/teleop_joy_ps4.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from launch import LaunchDescription
from launch_ros.actions import Node


# works for ps4 controller
def generate_launch_description():
return LaunchDescription(
[
# Node(
# package="joy",
# executable="joy_node",
# name="joy_node",
# parameters=[
# {"dev": "/dev/input/js0", "deadzone": 0.1, "autorepeat_rate": 20.0}
# ],
# ),
Node(
package="joy_linux",
executable="joy_linux_node",
name="joy_linux_node",
parameters=[{"deadzone": 0.1, "autorepeat_rate": 20.0}],
),
Node(
package="teleop_twist_joy",
executable="teleop_node",
name="teleop_joy_node",
parameters=[
{
"axis_linear.x": 1,
"axis_angular.yaw": 0,
"axis_linear.y": 6,
"scale_linear.x": 1.0,
"scale_linear.y": 1.0,
"scale_angular.yaw": 4.0,
"enable_button": 4,
# 'scale_angular': 1.0
}
],
remappings=[("/cmd_vel", "/mirte_base_controller/cmd_vel")],
),
]
)
7 changes: 5 additions & 2 deletions mirte_teleop/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

<exec_depend>teleop_twist_keyboard</exec_depend>
<exec_depend>diagnostic_updater</exec_depend>
<!-- <exec_depend>joy</exec_depend>

<exec_depend>joy</exec_depend>
<exec_depend>teleop_twist_joy</exec_depend>
-->
<exec_depend>rclpy</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>joy_linux</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
Loading