Skip to content

asa-naki/ros2_whill

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ros2_whill

ROS2 package for WHILL Model CR

ROS API

Subscribed Topics

/whill/controller/joy (sensor_msgs/Joy)

  • Virtual WHILL joystick input. You can controll WHILL via this topic.

/whill/controller/cmd_vel(geometry_msgs/Twist)

cmc_vel input. You can controll WHILL via this topic. This command is only available Model CR firmware updatedd after 2019.12. If you want to use this cmd_vel, please update firmware of Model CR by contact to sales of WHILL.

Published Topics

/whill/states/joy (sensor_msgs/Joy)

  • Joystick status

/whill/states/joint_state (sensor_msgs/JointState)

  • Wheel rotate position(rad) and rotation velocity(rad/s)

/whill/states/imu (sensor_msgs/Imu)

  • IMU measured data.

/whill/states/battery_state (sensor_msgs/BatteryState)

  • Battery information

Requirements

Build

please install before building

sudo apt install ros-galactic-xacro

In your shell:

cd ~/<your_ros2_ws>/src
git clone https://github.com/WHILL/ros2_whill_interfaces.git
git clone https://github.com/WHILL/ros2_whill.git
cd ~/<your_ros2_ws>
colcon build 
source install/setup.bash

SerialPort Settings

Set

Edit your ~/.bashrc (bash) or ~/.zshrc (zsh) to add this line:

export TTY_WHILL=/dev/[YOUR SERIAL PORT DEVICE]

Setting will be applied automatically from next shell starting or booting up.

Apply setting immediately

In your shell:

(bash)

source ~/.bashrc

(zsh)

source ~/.zshrc

Check the current setting

echo $TTY_WHILL  # -> Should be /dev/[YOUR SERIAL PORT DEVICE]

Set serial port as an argument of the launch file

Edit serialport value in the following parameter file and load the param file when you launch nodes.

vim ~/<your_ros2_ws>/src/ros2_whill/params/sample_param.yaml

Launch nodes

Controller node

ros2 run ros2_whill whill_modelc_controller

Publisher node

ros2 run ros2_whill whill_modelc_publisher

In the case of opening serial port failed

Edit

/lib/udev/rules.d/50-udev-default.rules

And add:

KERNEL=="ttyUSB[0-9]*", MODE="0666"

Call services

Change Speed Profile

ros2 service call /whill/set_speed_profile_srv ros2_whill_interfaces/SetSpeedProfile '{s1: 4, fm1: 15, fa1: 16, fd1: 64, rm1: 10, ra1: 16, rd1: 56, tm1: 10, ta1: 56, td1: 72}'

Power on

ros2 service call /whill/set_power_srv ros2_whill_interfaces/SetPower '{p0: 1}'

Power off

ros2 service call /whill/set_power_srv ros2_whill_interfaces/SetPower'{p0: 0}'

About

ROS2 package for WHILL model CR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.9%
  • Python 7.3%
  • CMake 4.8%