mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-31 23:19:32 +00:00
Compare commits
7 Commits
v0.23-rc.1
...
web-params
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2930eb9c22 | ||
|
|
64b083b242 | ||
|
|
b2ec48f0f3 | ||
|
|
b249524828 | ||
|
|
d0dcc0e72a | ||
|
|
4c6e7029e8 | ||
|
|
613f70fd25 |
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
sudo sh -c "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections"
|
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
|
sudo apt-get update && sudo apt-get install -y calibre msttcorefonts
|
||||||
builder/assets/install_gitbook.sh
|
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
|
npm install svgexport -g
|
||||||
gitbook -V
|
gitbook -V
|
||||||
markdownlint -V
|
markdownlint -V
|
||||||
|
|||||||
15
clover/examples/subscriber.py
Normal file
15
clover/examples/subscriber.py
Normal 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()
|
||||||
@@ -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;
|
let mouseDown;
|
||||||
|
|
||||||
topicMessage.addEventListener('mousedown', function() { mouseDown = true; });
|
topicMessage.addEventListener('mousedown', function() { mouseDown = true; });
|
||||||
@@ -61,6 +84,9 @@ topicMessage.addEventListener('mouseup', function() { mouseDown = false; });
|
|||||||
function init() {
|
function init() {
|
||||||
const params = Object.fromEntries(new URLSearchParams(window.location.search).entries());
|
const params = Object.fromEntries(new URLSearchParams(window.location.search).entries());
|
||||||
|
|
||||||
|
viewParameters();
|
||||||
|
return;
|
||||||
|
|
||||||
if (!params.topic) {
|
if (!params.topic) {
|
||||||
viewTopicsList();
|
viewTopicsList();
|
||||||
} else {
|
} else {
|
||||||
@@ -70,3 +96,5 @@ function init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.ros = ros;
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ function loadPrograms() {
|
|||||||
updateChanged();
|
updateChanged();
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
document.querySelector('.backend-fail').style.display = 'inline';
|
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;
|
runButton.disabled = true;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
33
clover_simulation/models/camera/camera.sdf
Normal file
33
clover_simulation/models/camera/camera.sdf
Normal 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>
|
||||||
13
clover_simulation/models/camera/model.config
Normal file
13
clover_simulation/models/camera/model.config
Normal 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>
|
||||||
@@ -3,18 +3,20 @@ Using rviz and rqt
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
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.
|
[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).
|
Install package `ros-melodic-desktop-full` or `ros-melodic-desktop` using the [installation documentation](http://wiki.ros.org/melodic/Installation/Ubuntu).
|
||||||
|
|
||||||
Start rviz
|
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)
|
```(bash)
|
||||||
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
## Высокоуровневое управление лентой {#set_effect}
|
## Высокоуровневое управление лентой {#set_effect}
|
||||||
|
|
||||||
1. Для работы с лентой подключите ее к питанию +5v – 5v, земле GND – GND и сигнальному порту DIN – GPIO21. Обратитесь [к инструкции по сборке](assemble_4_2.md#установка-led-ленты) для подробностей.
|
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
|
```xml
|
||||||
<arg name="led" default="true"/>
|
<arg name="led" default="true"/>
|
||||||
|
|||||||
@@ -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)).
|
Для использования 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).
|
На него необходимо установить пакет `ros-melodic-desktop-full` или `ros-melodic-desktop`, используя [документацию по установке](http://wiki.ros.org/melodic/Installation/Ubuntu).
|
||||||
|
|
||||||
Запуск rviz
|
Запуск rviz
|
||||||
---
|
---
|
||||||
|
|
||||||
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по Wi-Fi (`clover-xxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
|
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по [Wi-Fi](wifi.md) (`clover-xxxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
||||||
|
|||||||
Reference in New Issue
Block a user