![Mab Robotics MD80 x CANdle Скачать руководство пользователя страница 28](http://html1.mh-extra.com/html/mab-robotics/md80-x-candle/md80-x-candle_user-manual_3150547028.webp)
Quick start - ROS2
Letʼs run a simple example of the candle ROS2 node. In order to run the node, clone it into your local ROS2
workspace. A er that, build it with
colcon
and run using the
ros2 run
command. Be sure to source your
workspace with
source install/setup.bash
prior to running the package, and in each new terminal window
youre going to send commands related to the node.
First letʼs run the node with arguments that fit your MD80 x CANdle setup. The general syntax is:
ros2 run candle_ros2 candle_ros2_node <BUS> <FDCAN baud>
for more information on how to run the node you can call
ros2 run candle_ros2 candle_ros2_node --help.
Example output from the terminal a er launching the node:
In this example, we will be working with a USB bus and 8M FDCAN baudrate.
Adding drives
Firstly, the node should be informed which drives should be present on the FDCAN bus. This can be done via
/candle_ros2_node/add_md80s
service.
Note: Do not forget to source your ros2 workspace in new terminal
window
For example:
ros2 service call /candle_ros2_node/add_md80s candle_ros2/srv/AddMd80s "{drive_ids: [200,800]}"
Should produce the following output:
response:
candle_ros2.srv.AddMd80s_Response(drives_success=[True, True], total_number_of_drives=2)
informing, that both drives (ids: 200 and 800), have been successfully contacted, and were added to the
node's drives list.
You can also look for status messages in the terminal window where the node was started:
According to the status messages we have added two MD80 actuators. As you can see the speed mode
(NORMAL/FAST1/FAST2) is selected automatically based on the number of added drives.
www.mabrobotics.pl