Carla-Ros-Bridge, Simulation for planning and control.
根据carla-ros-bridge官方文档修改,使用launch文件一键启动仿真,控制需要接收车辆油门、刹车、方向盘转角(rad)三个参数。
- 安装Carla仿真软件,我这里使用的是Carla-0.9.12版本。
- 克隆本仓库并编译。
[email protected]:yizhiweimengxiangfendoudefeifei/Carla.git
pip install -r requirements.txt
catkin build
运行carla客户端
./CarlaUE4.sh --prefernvidia -quality-level=low -fps=20 -windowed -Resx=600 -Resy=480
编译成功本项目后,需要执行一下ROS命令:
source devel/setup.zsh && roslaunch carla_ros_bridge carla_pnc_bridge.launch
该脚本主要启动了以下脚本:
- carla_ros_bridge.launch,主要涉及carla客户端的通讯和设置。
- carla_example_ego_vehicle.launch,启动自车以及相关传感器的配置。
- carla_waypoint_publisher.launch,生成一条全局路径,可以使用rviz重新设置路径起点和终点,具体可以参考carla-ros-bridge。
- carla_ad_demo.rviz,打开rviz可视化。
如果需要适配carla客户端,算法端需要发布的形式如下:
carla_msgs::CarlaEgoVehicleControl msg;
msg.steer = steer;
if (speed >= 0) {
msg.throttle = speed;
msg.brake = 0;
} else {
msg.throttle = 0;
msg.brake = -speed / 8;
}
control_pub.publish(msg);
Distributed under the Apache-2.0 License. See LICENSE.txt
for more information.
In addition, We have kept the LICENSE of project Carla-Ros-Bridge in Carla-Ros-Bridge directory.
The co-simulation is modified on the basis of the following, thank you here.