This commit is contained in:
Blyron 2024-09-25 08:26:25 +02:00
commit 4feeb77b2b
6 changed files with 12 additions and 16 deletions

View File

@ -1,4 +1,5 @@
## Latest Changes ## Latest Changes
* Fixed a bug that caused navigation information not to be loaded when switching maps
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files * Prevent from segfault on failing SignalReference identification when loading OpenDrive files
* Added vehicle doors to the recorder * Added vehicle doors to the recorder
* Added functions to get actor' components transform * Added functions to get actor' components transform

View File

@ -736,7 +736,7 @@ The following tags are currently available (Note, tags changed from version 0.9.
| `14` | Car | `(0, 0, 142)` | Cars, vans | | `14` | Car | `(0, 0, 142)` | Cars, vans |
| `15` | Truck | `(0, 0, 70)` | Trucks | | `15` | Truck | `(0, 0, 70)` | Trucks |
| `16` | Bus | `(0, 60, 100)` | Busses | | `16` | Bus | `(0, 60, 100)` | Busses |
| `17` | Train | `(0, 60, 100)` | Trains | | `17` | Train | `(0, 80, 100)` | Trains |
| `18` | Motorcycle | `(0, 0, 230)` | Motorcycle, Motorbike | | `18` | Motorcycle | `(0, 0, 230)` | Motorcycle, Motorbike |
| `19` | Bicycle | `(119, 11, 32)` | Bicylces | | `19` | Bicycle | `(119, 11, 32)` | Bicylces |
| `20` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. | | `20` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. |

View File

@ -88,6 +88,12 @@ namespace detail {
const auto id = GetCurrentEpisode().GetId(); const auto id = GetCurrentEpisode().GetId();
_client.LoadEpisode(std::move(map_name), reset_settings, map_layers); _client.LoadEpisode(std::move(map_name), reset_settings, map_layers);
// delete the pointer to _episode so that the Navigation information
// will be loaded for the correct map
assert(_episode.use_count() == 1);
_episode.reset();
GetReadyCurrentEpisode();
// We are waiting 50ms for the server to reload the episode. // We are waiting 50ms for the server to reload the episode.
// If in this time we have not detected a change of episode, we try again // If in this time we have not detected a change of episode, we try again
// 'number_of_attempts' times. // 'number_of_attempts' times.

View File

@ -15,7 +15,6 @@
#include <boost/asio/connect.hpp> #include <boost/asio/connect.hpp>
#include <boost/asio/read.hpp> #include <boost/asio/read.hpp>
#include <boost/asio/write.hpp> #include <boost/asio/write.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/bind_executor.hpp> #include <boost/asio/bind_executor.hpp>
#include <exception> #include <exception>
@ -86,7 +85,6 @@ namespace tcp {
void Client::Connect() { void Client::Connect() {
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
if (_done) { if (_done) {
return; return;
} }
@ -139,18 +137,15 @@ namespace tcp {
log_debug("streaming client: connecting to", ep); log_debug("streaming client: connecting to", ep);
_socket.async_connect(ep, boost::asio::bind_executor(_strand, handle_connect)); _socket.async_connect(ep, boost::asio::bind_executor(_strand, handle_connect));
});
} }
void Client::Stop() { void Client::Stop() {
_connection_timer.cancel(); _connection_timer.cancel();
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
_done = true; _done = true;
if (_socket.is_open()) { if (_socket.is_open()) {
_socket.close(); _socket.close();
} }
});
} }
void Client::Reconnect() { void Client::Reconnect() {
@ -165,7 +160,6 @@ namespace tcp {
void Client::ReadData() { void Client::ReadData() {
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
if (_done) { if (_done) {
return; return;
} }
@ -182,7 +176,7 @@ namespace tcp {
// Move the buffer to the callback function and start reading the next // Move the buffer to the callback function and start reading the next
// piece of data. // piece of data.
// log_debug("streaming client: success reading data, calling the callback"); // log_debug("streaming client: success reading data, calling the callback");
boost::asio::post(_strand, [self, message]() { self->_callback(message->pop()); }); self->_callback(message->pop());
ReadData(); ReadData();
} else { } else {
// As usual, if anything fails start over from the very top. // As usual, if anything fails start over from the very top.
@ -219,7 +213,6 @@ namespace tcp {
_socket, _socket,
message->size_as_buffer(), message->size_as_buffer(),
boost::asio::bind_executor(_strand, handle_read_header)); boost::asio::bind_executor(_strand, handle_read_header));
});
} }
} // namespace tcp } // namespace tcp

View File

@ -79,7 +79,6 @@ namespace tcp {
DEBUG_ASSERT(message != nullptr); DEBUG_ASSERT(message != nullptr);
DEBUG_ASSERT(!message->empty()); DEBUG_ASSERT(!message->empty());
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [=]() {
if (!_socket.is_open()) { if (!_socket.is_open()) {
return; return;
} }
@ -111,11 +110,8 @@ namespace tcp {
log_debug("session", _session_id, ": sending message of", message->size(), "bytes"); log_debug("session", _session_id, ": sending message of", message->size(), "bytes");
_deadline.expires_from_now(_timeout); _deadline.expires_from_now(_timeout);
boost::asio::async_write( boost::asio::async_write(_socket, message->GetBufferSequence(),
_socket, boost::asio::bind_executor(_strand, handle_sent));
message->GetBufferSequence(),
handle_sent);
});
} }
void ServerSession::Close() { void ServerSession::Close() {

View File

@ -138,7 +138,7 @@ LibCarla.client.rss.release: setup ad-rss
plugins: plugins:
@${CARLA_BUILD_TOOLS_FOLDER}/Plugins.sh $(ARGS) @${CARLA_BUILD_TOOLS_FOLDER}/Plugins.sh $(ARGS)
setup downloadplugins: setup: downloadplugins
@${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh $(ARGS) @${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh $(ARGS)
ad-rss: ad-rss: