Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lidar #1434

Merged
merged 17 commits into from Dec 20, 2021
Merged

Lidar #1434

merged 17 commits into from Dec 20, 2021

Conversation

IKhonakhbeeva
Copy link
Contributor

Пример qrs-ки на то, чтобы поизучать поведение (нужно заменить расширение файла обратно на qrs) lidar.zip

@IKhonakhbeeva IKhonakhbeeva added this to the 2021.3 milestone Sep 30, 2021
iakov
iakov previously approved these changes Oct 2, 2021
@@ -171,6 +172,8 @@ QString SensorItem::name() const
return "color_blue";
} else if (sensor.isA<robotParts::RangeSensor>()) {
return "range";
} else if (sensor.isA<robotParts::LidarSensor>()) {
return "range";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А вместо этих else if нельзя возвращать sensor->name()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет, потому что sensor->name это что-то условно уникальное и характеризующее сам датчик, а те имена, что тут возвращаются, используются для выбора картинки, если ее не задали

@iakov iakov self-requested a review October 2, 2021 16:22
@@ -234,7 +251,7 @@ QStringList TrikBrick::sensorPorts(trikControl::SensorInterface::Type type) cons
{
Q_UNUSED(type)
// QLOG_INFO() << "Sensor type is ignored";
return mMotors.keys();
return mSensors.keys();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ого! И раньше же не мешало, похоже :)

{
using namespace kitBase::robotModel;
if (!mLidars.contains(port)) {
robotParts::VectorSensor * lidar =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto *lidar = ...?

if (!mLidars.contains(port)) {
robotParts::VectorSensor * lidar =
RobotModelUtils::findDevice<robotParts::VectorSensor>(*mTwoDRobotModel, port);
if (lidar == nullptr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!lidar)?


QVector<int> TrikLidarEmu::read() const
{
QMetaObject::invokeMethod(mLidar, "read");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы хотим блокировать и подождать? Или хотим именно инициировать асинхронный вызов?
Лучше методы вызывать по указателю, а не по имени, если есть соответствующая сигнатура


// DeviceInterface interface
public:
TrikLidarEmu(kitBase::robotModel::robotParts::VectorSensor *lidar);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit TrikLidarEmu?

QVector<int> read() const override;

private:
kitBase::robotModel::robotParts::VectorSensor *mLidar;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше делать инициализацию через {}, это не помешает. А кто тут владелец объекта? Надо бы комментарием указать, если нет владения.

@iakov
Copy link
Member

iakov commented Dec 18, 2021

Нужно ещё :

  1. взять последний рантайм
  2. удовлетворить Веру.

@IKhonakhbeeva
Copy link
Contributor Author

Сделано

@iakov iakov merged commit 385101d into trikset:master Dec 20, 2021
mergify bot added a commit that referenced this pull request Mar 1, 2023
* Bump thirdparty/gamepad/gamepad from `5f9ead9` to `d7870ad`

Bumps [thirdparty/gamepad/gamepad](https://github.com/trikset/trik-desktop-gamepad) from `5f9ead9` to `d7870ad`.
- [Release notes](https://github.com/trikset/trik-desktop-gamepad/releases)
- [Commits](trikset/trik-desktop-gamepad@5f9ead9...d7870ad)

---
updated-dependencies:
- dependency-name: thirdparty/gamepad/gamepad
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump plugins/robots/thirdparty/hidapi from `4ab60e0` to `b66d7c2` (#1481)

Bumps [plugins/robots/thirdparty/hidapi](https://github.com/libusb/hidapi) from `4ab60e0` to `b66d7c2`.
- [Release notes](https://github.com/libusb/hidapi/releases)
- [Commits](libusb/hidapi@4ab60e0...b66d7c2)

---
updated-dependencies:
- dependency-name: plugins/robots/thirdparty/hidapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add 'any' for all objects of inside tag

* Lupdate

* Fix crash when mailbox is not enabled (#1486)

* Bump plugins/robots/thirdparty/hidapi from `b66d7c2` to `d67b5c9`

Bumps [plugins/robots/thirdparty/hidapi](https://github.com/libusb/hidapi) from `b66d7c2` to `d67b5c9`.
- [Release notes](https://github.com/libusb/hidapi/releases)
- [Commits](libusb/hidapi@b66d7c2...d67b5c9)

---
updated-dependencies:
- dependency-name: plugins/robots/thirdparty/hidapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump thirdparty/checkapp/checkapp from `35e4399` to `80ab06e` (#1493)

Bumps [thirdparty/checkapp/checkapp](https://github.com/trikset/trik-checkapp) from `35e4399` to `80ab06e`.
- [Release notes](https://github.com/trikset/trik-checkapp/releases)
- [Commits](trikset/trik-checkapp@35e4399...80ab06e)

---
updated-dependencies:
- dependency-name: thirdparty/checkapp/checkapp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump qrtest/thirdparty/googletest/googletest from `bf0701d` to `97a4675` (#1494)

Bumps [qrtest/thirdparty/googletest/googletest](https://github.com/google/googletest) from `bf0701d` to `97a4675`.
- [Release notes](https://github.com/google/googletest/releases)
- [Commits](google/googletest@bf0701d...97a4675)

---
updated-dependencies:
- dependency-name: qrtest/thirdparty/googletest/googletest
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Lidar (#1434)

* Add lidar reading

* Add lidar as sensor

* Simulate lidar

* Add lidar emulation for trikbrick

* Fixes after review

* No need to reread sensor

* Polish lidar working

* Add Read Lidar Block

* Add Read Lidar block to palette

* Add generator for Read Lidar block

* Disable Read Lidar Block

* Need to draw image with real display width and hight

* Lupdate

* Fix build

* Make Vera happy

* Update Runtime

* Make Vera happy

* Fix Python.zip problem (#1497)

* Add lidar example (#1496)

* Bump thirdparty/checkapp/checkapp from `80ab06e` to `3df13d6` (#1504)

Bumps [thirdparty/checkapp/checkapp](https://github.com/trikset/trik-checkapp) from `80ab06e` to `3df13d6`.
- [Release notes](https://github.com/trikset/trik-checkapp/releases)
- [Commits](trikset/trik-checkapp@80ab06e...3df13d6)

---
updated-dependencies:
- dependency-name: thirdparty/checkapp/checkapp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump plugins/robots/thirdparty/hidapi from `d67b5c9` to `af6c601` (#1502)

Bumps [plugins/robots/thirdparty/hidapi](https://github.com/libusb/hidapi) from `d67b5c9` to `af6c601`.
- [Release notes](https://github.com/libusb/hidapi/releases)
- [Commits](libusb/hidapi@d67b5c9...af6c601)

---
updated-dependencies:
- dependency-name: plugins/robots/thirdparty/hidapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* GHA CI: Shift to Qt 5.12.12

* CI: Fix tagged Windows build with multiple tags

* Pioneer (#1506)

* Add setting for pioneer
* Add simple pioneer's blocks
* Fix build
* Change uploading logic
* Add switch block generation
* Add 'GPIO Init' block
* Add 'Set GPIO state' block
* Add 'Read GPIO' block
* Add pioneer additional settings on settings page
* Use QT IFW 4.3
* Add images
* Add descriptions and translations

* Spilt save file format (#1525)

* First step to split save info

* Fix patcher with images (#1536)

* Set/move robot start position from the context menu (#1505)

* Fix text for read-only flags
* Add button to set robot start position under current robot pos
* Fix read-only sensors behavior
* Use QT IFW 4.3
* Delete vanished translations
* Clean the code

* Remove `strict` from mergify.io config

`Strict` is obsolete now

* Fix patcher with blobs (#1538)

* No need to autoconfigure mototrs (#1540)

* Save format (#1537)

* Split serialize for worldModel and robotModel
* Split desirialize for worldModel and robotModel and fix some old bugs
* Remove annoying warning
* Update version number
* Change version to 2022.2
* Add version conversion to console mode too
* Add messages from project manager to console

* No need encoders auto-configuration (#1547)

* No need encoders auto-configuration

* Lupdate

* Drop cursor on ESC (#1553)

* Drop cursor on ESC

* Fix build and add message for updating QT IFW

* Checker (#1552)

* Add message trigger to checker
* Open 2d model even with errors
* Add interpretation errored

* Add comment item to 2D (#1541)

* Add text to comment item
* Add drawComment cursor
* Add pallete icon for comment item
* Add comment item in world model deserialize
* Fix build and add message for updating QT IFW
* Drop cursor on ESC

* Add checker runtime with bionic base

* Ignore false memleak

* Force Qt5.12 and QtIfw 4.2.0

Switch Azure build to macOS-11 hosts, macOS-10.15 is deprecated
GHA: install proper version of QtIfw
macOS: use Qt5.12 and QtIfw 4.2.0

[trik-runtime] update

* Fix macOS installer build
Fix macOS tests
macOS set Python version outside'

* Add correct TRIK_PYTHONPATH for tests

* .gitignore pyinstaller artifacts

* Add QtSerialPort to installer

* Mass fix missing quotes in scripts

* Use rsync instead of cp

* Fix rcc and moc calls

* Fix gcc-10 build

* Initial docker image to build for ALT linux

* Fix mingw path for rsync

* Add DPI logging

And related settings

* Fix opening some saves (#1566)

* Enable Asan for integration tests

* Add default values for installer script

* submodules update

* Fix Linux build: ignore git warnings

* Fix Linux build: ignore git warnings

* Set global git option to ignore directory owner

* Fix translations

* Hotfix for 2022.2 linux build (#1580)

* Set global git option to ignore directory owner

* Fix translations

* Fix problem with current configuration (#1581)

* Use QextSerialPort as submodule

* Lupdate

* Update submodules

* Introduce CONFIG+=use_system_quazip

but quazip mostly lacks pkg-config support in main distros

* Support CONFIG+=use_system_quazip + Python 3.10 compatibility

* Fix memleak in dock window

* Purge obsolete garbage

* Load qt5 translations (#1594)

Load qt5 translations for modules

* Remove falty pkg-config --list-all (#1599)

* Remove falty `pkg-config --list-all`, that causes crash at the moment on macOS build host
* Sloppy ccache for Azure
* Remove pessimising move
* Azure: add caching on build timeout, but skip full build (UNFINISHED)
* Azure: split build scripts

* Set startup language to system if not set from config (#1598)

* Support startup with system locale
* Enable early logging to console
* Code cleanup

* Fix NPE

But this crash is caused by some architecture issue...

* Add variables to checker messages (#1602)

* Add variables in messages from checker
```xml
            <triggers>
                <success/>
		<message text="We have finished! Score: %myvar%" >
			<replace var="myvar">
				<sum> <!-- this expression is like in the 'setter' tag -->
					<variableValue name="total_score"/>
					<int value="2"/>
				</sum>
			</replace>
		</message>
            </triggers>
        </event>
```
Co-authored-by: IKhonakhbeeva <i.khonakhbeeva@gmail.com>

* Add log trigger (#1603)

* Add log trigger

* Lupdate

* Installer script: support both QtIFw 3.x and 4.x

* 2D-model: add option --close to close window on exit

* Add onSuccess event (#1604)

* Add onSuccess event

* Add true condition

* Allow multiple on_success handlers

* Use script instead of sshpass on Windows

* Fix lost robot's position for loadWorldModel action (#1622)

* Fix lost robot's position for loadWorldModel action
* Fix deploy
Co-authored-by: iakov <iakov@users.noreply.github.com>

* Fix sin/cos and small values display (#1631)

* Fix printing very small values for printTextBlock

* Use degrees for sin and cos in block's programming instead of radians

* Fix sin/cos generation for python and js on trik

* Fix printTextBlock for trik too

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: iakov <iakov@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Andrei Khodko <andrei.khodko@gmail.com>
Co-authored-by: Iakov 'Jake' Kirilenko <jake.kirilenko@gmail.com>
Co-authored-by: Vladimir Kutuev <vladimir.kutuev@gmail.com>
Co-authored-by: Iakov Kirilenko <iakov@trikset.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants