Compare commits

...

7 Commits

Author SHA1 Message Date
Oleg Kalachev
2930eb9c22 Read parameters from web (unfinished) 2021-10-06 21:18:02 +03:00
Oleg Kalachev
64b083b242 Add external camera model 2021-10-06 21:17:21 +03:00
Oleg Kalachev
b2ec48f0f3 blocks: minor fix 2021-10-06 17:53:25 +03:00
Oleg Kalachev
b249524828 Use markdownlint-cli@0.28.1 as of https://github.com/DavidAnson/markdownlint/issues/435 2021-10-05 16:33:38 +03:00
Oleg Kalachev
d0dcc0e72a docs: some fixes to rviz article 2021-10-05 15:34:59 +03:00
Oleg Kalachev
4c6e7029e8 docs: fix 2021-09-26 18:23:52 +03:00
Oleg Kalachev
613f70fd25 Add subscriber example 2021-09-24 17:34:54 +03:00
9 changed files with 100 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ jobs:
sudo sh -c "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections"
sudo apt-get update && sudo apt-get install -y calibre msttcorefonts
builder/assets/install_gitbook.sh
npm install markdownlint-cli -g
npm install markdownlint-cli@0.28.1 -g # FIXME: https://github.com/DavidAnson/markdownlint/issues/435
npm install svgexport -g
gitbook -V
markdownlint -V

View File

@@ -0,0 +1,15 @@
# Information: https://clover.coex.tech/en/laser.html
import rospy
from sensor_msgs.msg import Range
rospy.init_node('process_rangefinder')
def range_callback(msg):
# Process data from the rangefinder
print('Rangefinder distance:', msg.range)
# Subscribe to laser rangefinder data
rospy.Subscriber('rangefinder/range', Range, range_callback)
rospy.spin()

View File

@@ -53,6 +53,29 @@ function viewTopic(topic) {
});
}
function viewParameters() {
title.innerHTML = 'Parameters';
topicMessage.style.display = 'block';
let names = ['aruco_detect', 'main_camera', 'main_camera_nodelet_manager', 'mavros', 'optical_flow',
'rangefinder', 'rosapi', 'rosbridge_websocket', 'rosdistro', 'roslaunch', 'rosversion',
'roswww_static', 'run_id', 'simple_offboard', 'visualization', 'web_video_server'];
let params = {};
// ros.getParams(function(params) {
Promise.all(names.map(function(name) {
return new Promise(function(resolve, reject) {
new ROSLIB.Param({ ros, name }).get(function(value) {
params[name] = value;
resolve();
})
});
})).then(function() {
console.log(params);
topicMessage.innerHTML = yamlStringify(params);
});
}
let mouseDown;
topicMessage.addEventListener('mousedown', function() { mouseDown = true; });
@@ -61,6 +84,9 @@ topicMessage.addEventListener('mouseup', function() { mouseDown = false; });
function init() {
const params = Object.fromEntries(new URLSearchParams(window.location.search).entries());
viewParameters();
return;
if (!params.topic) {
viewTopicsList();
} else {
@@ -70,3 +96,5 @@ function init() {
});
}
}
window.ros = ros;

View File

@@ -211,7 +211,7 @@ function loadPrograms() {
updateChanged();
}, function(err) {
document.querySelector('.backend-fail').style.display = 'inline';
alert(`Error loading programs list.\n\nHave you enabled clover_blocks in clover.launch?`);
alert(`Error loading programs list.\n\nHave you enabled 'blocks' in clover.launch?`);
runButton.disabled = true;
})
}

View File

@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<sdf version="1.5">
<model name="camera">
<static>true</static>
<link name='camera_link'>
<pose>0 0 0 0 0 0</pose>
<sensor name='camera' type='camera'>
<camera>
<horizontal_fov>2.0944</horizontal_fov>
<image>
<format>B8G8R8</format>
<width>800</width>
<height>600</height>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
</camera>
<always_on>1</always_on>
<update_rate>20</update_rate>
<visualize>1</visualize>
<plugin name='camera_plugin' filename='libgazebo_ros_camera.so'>
<alwaysOn>1</alwaysOn>
<imageTopicName>image_raw</imageTopicName>
<cameraTopicName>camera_info</cameraTopicName>
<cameraName>camera</cameraName>
<frameName>/camera</frameName>
</plugin>
</sensor>
</link>
</model>
</sdf>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<model>
<name>Camera</name>
<version>1.0</version>
<sdf version="1.5">camera.sdf</sdf>
<author>
<name>Oleg Kalachev</name>
<email>okalachev@gmail.com</email>
</author>
<description>
External camera
</description>
</model>

View File

@@ -3,18 +3,20 @@ Using rviz and rqt
![rviz](../assets/rviz.png)
The [rviz] tool(http://wiki.ros.org/rviz) allows real-time visualization of all components of the robotic system —the system of coordinates, moving parts, sensors, camera images — on the 3D stage.
The [rviz](http://wiki.ros.org/rviz) tool allows real-time visualization of all components of the robotic system —the system of coordinates, moving parts, sensors, camera images — on the 3D stage.
[rqt](http://wiki.ros.org/rqt) is a set of GUI for analyzing and controlling ROS systems. For example, `rqt_image_view` allows viewing topics with images, `rqt_multiplot` allows plot charts by the values in topics, etc.
To use rviz and rqt, a PC running Ubuntu Linux (or a virtual machine such as [Parallels Desktop Lite] (https://itunes.apple.com/ru/app/parallels-desktop-lite/id1085114709?mt=12) or [VirtualBox] (https://www.virtualbox.org)) is required.
To use rviz and rqt, a PC running Ubuntu Linux (or a virtual machine such as [Parallels Desktop Lite](https://itunes.apple.com/ru/app/parallels-desktop-lite/id1085114709?mt=12) or [VirtualBox](https://www.virtualbox.org)) is required.
> **Hint** You can use the [preconfigured virtual machine image](simulation_vm.md) with ROS and Clover toolkit.
Install package `ros-melodic-desktop-full` or `ros-melodic-desktop` using the [installation documentation](http://wiki.ros.org/melodic/Installation/Ubuntu).
Start rviz
---
To start the Clover state visualization in real time, connect to it via Wi-Fi (`clover-xxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
To start the Clover state visualization in real time, connect to it [via Wi-Fi](wifi.md) (`clover-xxxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
```(bash)
ROS_MASTER_URI=http://192.168.11.1:11311 rviz

View File

@@ -17,7 +17,7 @@
## Высокоуровневое управление лентой {#set_effect}
1. Для работы с лентой подключите ее к питанию +5v 5v, земле GND GND и сигнальному порту DIN GPIO21. Обратитесь [к инструкции по сборке](assemble_4_2.md#установка-led-ленты) для подробностей.
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clever/clever/launch/clover.launch`:
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
```xml
<arg name="led" default="true"/>

View File

@@ -9,12 +9,14 @@
Для использования rviz и rqt необходим компьютер с ОС Ubuntu Linux (либо виртуальная машина, например [Parallels Desktop Lite](https://itunes.apple.com/ru/app/parallels-desktop-lite/id1085114709?mt=12) или [VirtualBox](https://www.virtualbox.org)).
> **Hint** Вы можете можете использовать готовый [образ виртуальной машины](simulation_vm.md) с инструментами для Клевера.
На него необходимо установить пакет `ros-melodic-desktop-full` или `ros-melodic-desktop`, используя [документацию по установке](http://wiki.ros.org/melodic/Installation/Ubuntu).
Запуск rviz
---
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по Wi-Fi (`clover-xxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по [Wi-Fi](wifi.md) (`clover-xxxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
```bash
ROS_MASTER_URI=http://192.168.11.1:11311 rviz