A Gentle Introduction to rosrust, and its actionlib Support
rosrust, and actionlib
Overview
Introduction
My name is Salvatore and I am a Development Engineer at 주식회사 Rist .
About this article
This article is meant to be a quick and direct introduction to the actionlib support in rosrust, based on the examples of the rosrust repository .
rosrust
What is rosrust
rosrust is a Rust implementation of a ROS client library.
Being rosrust a Rust crate , it assumes an existing underlying Rust environment in order to be used.
Why it is needed
rosrust allows to interface code written in Rust to the standard ROS environment.
Installation
환경
소프트웨어
버전
OS
우분투 18.04.4 LTS (Bionic Beaver)
파이썬
파이썬 2.7.17
Python 3.6.9 (Default)
ROS
ROS 1 (Melodic)
Rust
Rust 1.45.2 (d3fb005a3 2020-07-31)
rosrust
rosrust v0.9.3
For information on setting up a ROS 1 Melodic
environment on a machine running Ubuntu, refer to the official documentation .
Rust
The installation of Rust is straight forward and all the needed packages will be located into the user home directory.
Introduction
My name is Salvatore and I am a Development Engineer at 주식회사 Rist .
About this article
This article is meant to be a quick and direct introduction to the actionlib support in rosrust, based on the examples of the rosrust repository .
rosrust
What is rosrust
rosrust is a Rust implementation of a ROS client library.
Being rosrust a Rust crate , it assumes an existing underlying Rust environment in order to be used.
Why it is needed
rosrust allows to interface code written in Rust to the standard ROS environment.
Installation
환경
소프트웨어
버전
OS
우분투 18.04.4 LTS (Bionic Beaver)
파이썬
파이썬 2.7.17
Python 3.6.9 (Default)
ROS
ROS 1 (Melodic)
Rust
Rust 1.45.2 (d3fb005a3 2020-07-31)
rosrust
rosrust v0.9.3
For information on setting up a ROS 1 Melodic
environment on a machine running Ubuntu, refer to the official documentation .
Rust
The installation of Rust is straight forward and all the needed packages will be located into the user home directory.
환경
소프트웨어
버전
OS
우분투 18.04.4 LTS (Bionic Beaver)
파이썬
파이썬 2.7.17
Python 3.6.9 (Default)
ROS
ROS 1 (Melodic)
Rust
Rust 1.45.2 (d3fb005a3 2020-07-31)
rosrust
rosrust v0.9.3
For information on setting up a
ROS 1 Melodic
environment on a machine running Ubuntu, refer to the official documentation .Rust
The installation of Rust is straight forward and all the needed packages will be located into the user home directory.
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
$ rustc --version
For more details on the installation, or alternative platforms, refer to The Rust Programming Language book, or the official documentation .
rosrust
The rosrust crate is available at the official github repository .
$ git clone https://github.com/adnanademovic/rosrust.git
Note: in order to successfully build the rosrust crate, due to message dependencies, it is necessary to source the ROS installation path.
$ . /opt/ros/melodic/setup.bash
$ cargo build
At this point, the rosrust crate is available for use.
Verify the installation
To verify the correct installation of the rosrust crate, it is possible to run the examples provided by the crate itself.
$ cargo run --example
slb@salvatorepc: rosrust (master=) $ cargo run --example
error: "--example" takes one argument.
Available examples:
access_image_message
camera_subscriber
client
client_node
example
fibonacci_cancelling_client
fibonacci_client
fibonacci_multi_call_client
fibonacci_server
frequency_status
function_task
function_task_extra
old_client
old_service
parameters
publisher
publisher_latch_demo
publisher_node
pubsub_loopback
service
service_node
subscriber
subscriber_node
subscriber_with_ids
Next, it will be shown the simplest publisher/subscriber example in order to determine the correct behaviour of the ROS/rosrust environment.
Running the publisher/subscriber example
Considering the simplest example of the communication between a publisher and a subscriber on a common topic.
Shell 1: roscore
$ . /opt/ros/melodic/setup.bash
$ roscore
Shell 2: publisher
$ . /opt/ros/melodic/setup.bash
$ cargo run --example publisher
Shell 3: subscriber
$ . /opt/ros/melodic/setup.bash
$ cargo run --example subscriber
Shell 4: topics
$ . /opt/ros/melodic/setup.bash
$ rosnode list
$ rostopic list
$ rostopic info /chatter
$ rostopic echo /chatter
Terminals
Running the actionlib example
The actionlib example shows a fully functional integration with the ROS actionlib .
Shell 1: roscore
$ . /opt/ros/melodic/setup.bash
$ roscore
Shell 2: fibonacci_server
$ . /opt/ros/melodic/setup.bash
$ cargo run --example fibonacci_server
Shell 3: fibonacci_client
$ . /opt/ros/melodic/setup.bash
$ cargo run --example fibonacci_client
Terminals
As shown earlier, there are a lot more examples available in the rosrust crate. Feel free to try them all!
References
Reference
이 문제에 관하여(A Gentle Introduction to rosrust, and its actionlib Support), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/slabua/items/68f889512025ff8169f9텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)