Merge branch 'dev' into jose/adjustvehiclebb
This commit is contained in:
commit
bc96c5feb9
|
@ -1,7 +1,8 @@
|
|||
## Latest Changes
|
||||
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files
|
||||
* Added vehicle doors to the recorder
|
||||
* Adjusted vehicle BoundingBox when the vehicle opens the doors.
|
||||
* Added vehicle doors to the recorder
|
||||
* Adjusted vehicle BoundingBox when the vehicle opens the doors.
|
||||
* Added functions to get actor' components transform
|
||||
|
||||
## CARLA 0.9.15
|
||||
|
||||
|
|
|
@ -422,10 +422,10 @@ Drag your desired foliage item into the box labeled `+ Drop Foliage Here`. Set a
|
|||
To export a map as a map package that can be ingested into a standalone CARLA package installation, use the `make package` command as follows:
|
||||
|
||||
```sh
|
||||
make package ARGS="--packages=<mapPackage>"
|
||||
make package ARGS="--packages=<mapName>"
|
||||
```
|
||||
|
||||
The `<mapPackage>` must point to a json file located in `CARLA_ROOT/Unreal/CarlaUE4/Content/Carla/Config` named *mapPackage.json* which has the following structure:
|
||||
The `<mapName>` must point to a json file located in `CARLA_ROOT/Unreal/CarlaUE4/Content/Carla/Config` named *mapName.Package.json* which has the following structure:
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
|
@ -189,12 +189,14 @@ pipeline
|
|||
sh 'DISPLAY= ./Dist/CarlaUE4.sh -nullrhi -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &'
|
||||
sh 'make smoke_tests ARGS="--xml --python-version=3.8 --target-wheel-platform=manylinux_2_27_x86_64"'
|
||||
sh 'make run-examples ARGS="localhost 3654"'
|
||||
sh 'tar -czf CarlaUE4_logs.tar.gz Unreal/CarlaUE4/Saved/Logs/'
|
||||
}
|
||||
post
|
||||
{
|
||||
always
|
||||
{
|
||||
archiveArtifacts 'CarlaUE4.log'
|
||||
archiveArtifacts 'CarlaUE4_logs.tar.gz'
|
||||
junit 'Build/test-results/smoke-tests-*.xml'
|
||||
}
|
||||
}
|
||||
|
@ -320,6 +322,13 @@ pipeline
|
|||
}
|
||||
}
|
||||
}
|
||||
post
|
||||
{
|
||||
always
|
||||
{
|
||||
deleteDir()
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
stage('windows')
|
||||
|
|
|
@ -32,6 +32,14 @@ namespace client {
|
|||
return GetEpisode().Lock()->GetActorAcceleration(*this);
|
||||
}
|
||||
|
||||
geom::Transform Actor::GetComponentWorldTransform(const std::string componentName) const {
|
||||
return GetEpisode().Lock()->GetActorComponentWorldTransform(*this, componentName);
|
||||
}
|
||||
|
||||
geom::Transform Actor::GetComponentRelativeTransform(const std::string componentName) const {
|
||||
return GetEpisode().Lock()->GetActorComponentRelativeTransform(*this, componentName);
|
||||
}
|
||||
|
||||
void Actor::SetLocation(const geom::Location &location) {
|
||||
GetEpisode().Lock()->SetActorLocation(*this, location);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,10 @@ namespace client {
|
|||
/// acceleration calculated after the actor's velocity.
|
||||
geom::Vector3D GetAcceleration() const;
|
||||
|
||||
geom::Transform GetComponentWorldTransform(const std::string componentName) const;
|
||||
|
||||
geom::Transform GetComponentRelativeTransform(const std::string componentName) const;
|
||||
|
||||
/// Teleport the actor to @a location.
|
||||
void SetLocation(const geom::Location &location);
|
||||
|
||||
|
|
|
@ -408,6 +408,14 @@ namespace detail {
|
|||
_pimpl->AsyncCall("add_actor_torque", actor, vector);
|
||||
}
|
||||
|
||||
geom::Transform Client::GetActorComponentWorldTransform(rpc::ActorId actor, const std::string componentName) {
|
||||
return _pimpl->CallAndWait<geom::Transform>("get_actor_component_world_transform", actor, componentName);
|
||||
}
|
||||
|
||||
geom::Transform Client::GetActorComponentRelativeTransform(rpc::ActorId actor, const std::string componentName) {
|
||||
return _pimpl->CallAndWait<geom::Transform>("get_actor_component_relative_transform", actor, componentName);
|
||||
}
|
||||
|
||||
void Client::SetActorSimulatePhysics(rpc::ActorId actor, const bool enabled) {
|
||||
_pimpl->CallAndWait<void>("set_actor_simulate_physics", actor, enabled);
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ namespace detail {
|
|||
|
||||
void DestroyTrafficManager(uint16_t port) const;
|
||||
|
||||
|
||||
void SetTimeout(time_duration timeout);
|
||||
|
||||
time_duration GetTimeout() const;
|
||||
|
@ -232,6 +233,14 @@ namespace detail {
|
|||
rpc::ActorId actor,
|
||||
const geom::Vector3D &vector);
|
||||
|
||||
geom::Transform GetActorComponentWorldTransform(
|
||||
rpc::ActorId actor,
|
||||
const std::string componentName);
|
||||
|
||||
geom::Transform GetActorComponentRelativeTransform(
|
||||
rpc::ActorId actor,
|
||||
const std::string componentName);
|
||||
|
||||
void SetActorSimulatePhysics(
|
||||
rpc::ActorId actor,
|
||||
bool enabled);
|
||||
|
|
|
@ -438,6 +438,14 @@ namespace detail {
|
|||
return GetActorSnapshot(actor).acceleration;
|
||||
}
|
||||
|
||||
geom::Transform GetActorComponentWorldTransform(const Actor &actor, const std::string componentName) {
|
||||
return _client.GetActorComponentWorldTransform(actor.GetId(), componentName);
|
||||
}
|
||||
|
||||
geom::Transform GetActorComponentRelativeTransform(const Actor &actor, std::string componentName) {
|
||||
return _client.GetActorComponentRelativeTransform(actor.GetId(), componentName);
|
||||
}
|
||||
|
||||
void SetActorLocation(Actor &actor, const geom::Location &location) {
|
||||
_client.SetActorLocation(actor.GetId(), location);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,8 @@ void export_actor() {
|
|||
.def("get_velocity", &cc::Actor::GetVelocity)
|
||||
.def("get_angular_velocity", &cc::Actor::GetAngularVelocity)
|
||||
.def("get_acceleration", &cc::Actor::GetAcceleration)
|
||||
.def("get_component_world_transform", &cc::Actor::GetComponentWorldTransform, (arg("component_name")))
|
||||
.def("get_component_relative_transform", &cc::Actor::GetComponentRelativeTransform, (arg("component_name")))
|
||||
.def("set_location", &cc::Actor::SetLocation, (arg("location")))
|
||||
.def("set_transform", &cc::Actor::SetTransform, (arg("transform")))
|
||||
.def("set_target_velocity", &cc::Actor::SetTargetVelocity, (arg("velocity")))
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
|
||||
sys.version_info.major,
|
||||
sys.version_info.minor,
|
||||
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# -- imports -------------------------------------------------------------------
|
||||
# ==============================================================================
|
||||
|
||||
|
||||
import carla
|
||||
|
||||
client = carla.Client('localhost', 2000)
|
||||
world = client.get_world()
|
||||
|
||||
location = carla.Location(200.0, 200.0, 200.0)
|
||||
rotation = carla.Rotation(0.0, 0.0, 0.0)
|
||||
transform = carla.Transform(location, rotation)
|
||||
|
||||
bp_library = world.get_blueprint_library()
|
||||
bp_audi = bp_library.find('vehicle.audi.tt')
|
||||
audi = world.spawn_actor(bp_audi, transform)
|
||||
|
||||
component_transform = audi.get_component_world_transform('front-blinker-r-1')
|
||||
print(component_transform)
|
||||
|
|
@ -1274,6 +1274,94 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
|
|||
return R<void>::Success();
|
||||
};
|
||||
|
||||
BIND_SYNC(get_actor_component_world_transform) << [this](
|
||||
cr::ActorId ActorId,
|
||||
const std::string componentName) -> R<cr::Transform>
|
||||
{
|
||||
REQUIRE_CARLA_EPISODE();
|
||||
FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
|
||||
if (!CarlaActor)
|
||||
{
|
||||
return RespondError(
|
||||
"get_actor_component_world_transform",
|
||||
ECarlaServerResponse::ActorNotFound,
|
||||
" Actor Id: " + FString::FromInt(ActorId));
|
||||
}
|
||||
else
|
||||
{
|
||||
TArray<UActorComponent*> Components;
|
||||
CarlaActor->GetActor()->GetComponents(Components);
|
||||
|
||||
USceneComponent* Component;
|
||||
for(auto Cmp : Components)
|
||||
{
|
||||
if(USceneComponent* SCMP = Cast<USceneComponent>(Cmp))
|
||||
{
|
||||
if(SCMP->GetName() == componentName.c_str())
|
||||
{
|
||||
Component = SCMP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!Component)
|
||||
{
|
||||
return RespondError(
|
||||
"get_actor_component_world_transform",
|
||||
ECarlaServerResponse::ComponentNotFound,
|
||||
" Component Name: " + FString(componentName.c_str()));
|
||||
}
|
||||
|
||||
FTransform ComponentWorldTransform = Component->GetComponentTransform();
|
||||
return cr::Transform(ComponentWorldTransform);
|
||||
}
|
||||
};
|
||||
|
||||
BIND_SYNC(get_actor_component_relative_transform) << [this](
|
||||
cr::ActorId ActorId,
|
||||
const std::string componentName) -> R<cr::Transform>
|
||||
{
|
||||
REQUIRE_CARLA_EPISODE();
|
||||
FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
|
||||
if (!CarlaActor)
|
||||
{
|
||||
return RespondError(
|
||||
"get_actor_component_relative_transform",
|
||||
ECarlaServerResponse::ActorNotFound,
|
||||
" Actor Id: " + FString::FromInt(ActorId));
|
||||
}
|
||||
else
|
||||
{
|
||||
TArray<UActorComponent*> Components;
|
||||
CarlaActor->GetActor()->GetComponents(Components);
|
||||
|
||||
USceneComponent* Component;
|
||||
for(auto Cmp : Components)
|
||||
{
|
||||
if(USceneComponent* SCMP = Cast<USceneComponent>(Cmp))
|
||||
{
|
||||
if(SCMP->GetName() == componentName.c_str())
|
||||
{
|
||||
Component = SCMP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!Component)
|
||||
{
|
||||
return RespondError(
|
||||
"get_actor_component_world_transform",
|
||||
ECarlaServerResponse::ComponentNotFound,
|
||||
" Component Name: " + FString(componentName.c_str()));
|
||||
}
|
||||
|
||||
FTransform ComponentRelativeTransform = Component->GetRelativeTransform();
|
||||
return cr::Transform(ComponentRelativeTransform);
|
||||
}
|
||||
};
|
||||
|
||||
BIND_SYNC(get_physics_control) << [this](
|
||||
cr::ActorId ActorId) -> R<cr::VehiclePhysicsControl>
|
||||
{
|
||||
|
|
|
@ -14,6 +14,8 @@ FString CarlaGetStringError(ECarlaServerResponse Response)
|
|||
return "Sucess";
|
||||
case ECarlaServerResponse::ActorNotFound:
|
||||
return "Actor could not be found in the registry";
|
||||
case ECarlaServerResponse::ComponentNotFound:
|
||||
return "Component could not be found in this actor";
|
||||
case ECarlaServerResponse::ActorTypeMismatch:
|
||||
return "Actor does not match the expected type";
|
||||
case ECarlaServerResponse::MissingActor:
|
||||
|
|
|
@ -10,6 +10,7 @@ enum class ECarlaServerResponse
|
|||
{
|
||||
Success,
|
||||
ActorNotFound,
|
||||
ComponentNotFound,
|
||||
ActorTypeMismatch,
|
||||
FunctionNotSupported,
|
||||
NullActor,
|
||||
|
|
Loading…
Reference in New Issue