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

Car 5924 Migrate ROS Bridge to ROS2 #227

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
args="pub -l /system_alert cav_msgs/SystemAlert '{ type: 5, description: Simulated Drivers Ready }'"
/>

<!-- UI -->
<include file="$(find carma-messenger)/launch/ui.launch"/>

<!-- Traffic Incident Node -->
<include file="$(find traffic_incident)/launch/traffic_incident.launch"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,19 @@ def generate_launch_description():
]
)

ui_group = GroupAction(
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/ui.launch.py']),
),
]
)

return LaunchDescription([
declare_configuration_delay_arg,
declare_route_file_folder,
transform_group,
v2x_group,
plugins_group
plugins_group,
ui_group
])
32 changes: 0 additions & 32 deletions carma-messenger-core/carma-messenger/launch/ui.launch

This file was deleted.

50 changes: 50 additions & 0 deletions carma-messenger-core/carma-messenger/launch/ui.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (C) 2024 LEIDOS.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from launch import LaunchDescription
from launch.actions import GroupAction, IncludeLaunchDescription
from launch_ros.actions import SetRemap
from ament_index_python.packages import get_package_share_directory
from launch_xml.launch_description_sources import XMLLaunchDescriptionSource
import os


def generate_launch_description():
"""
Launch file for launching the nodes in the CARMA Messenger user interface stack
"""

params = os.path.join(
get_package_share_directory('carma-messenger'),
'ui',
'config',
'CommandAPIParams.yaml'
)

ui_group = GroupAction(
actions=[
SetRemap("system_alert", "/system_alert"),
SetRemap("bsm", "incoming_bsm"),
IncludeLaunchDescription(
XMLLaunchDescriptionSource(os.path.join(get_package_share_directory("rosbridge_server"), 'launch', 'rosbridge_websocket_launch.xml')),
launch_arguments = {
'params_glob' : [params],
}.items()
),
]
)

return LaunchDescription([
ui_group
])
2 changes: 1 addition & 1 deletion carma-messenger-ui/website/scripts/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function sendModalResponse(operatorResponse, serviceName) {
var serviceClient = new ROSLIB.Service({
ros : ros,
name : serviceName,
serviceType : 'std_srvs/SetBool'
serviceType : 'std_srvs/srv/SetBool'
});

// Then we create a Service Request. The object we pass in to ROSLIB.ServiceRequest matches the
Expand Down
12 changes: 6 additions & 6 deletions carma-messenger-ui/website/thirdparty/ros/roslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2774,7 +2774,7 @@
this.statusListener = new Topic({
ros : this.ros,
name : this.serverName + '/status',
messageType : 'actionlib_msgs/GoalStatusArray'
messageType : 'actionlib_msgs/msg/GoalStatusArray'
});

this.resultListener = new Topic({
Expand All @@ -2792,7 +2792,7 @@
this.cancelTopic = new Topic({
ros : this.ros,
name : this.serverName + '/cancel',
messageType : 'actionlib_msgs/GoalID'
messageType : 'actionlib_msgs/msg/GoalID'
});

// advertise the goal and cancel topics
Expand Down Expand Up @@ -2917,7 +2917,7 @@
var statusListener = new Topic({
ros : this.ros,
name : this.serverName + '/status',
messageType : 'actionlib_msgs/GoalStatusArray'
messageType : 'actionlib_msgs/msg/GoalStatusArray'
});

var resultListener = new Topic({
Expand Down Expand Up @@ -3085,7 +3085,7 @@
var statusPublisher = new Topic({
ros : this.ros,
name : this.serverName + '/status',
messageType : 'actionlib_msgs/GoalStatusArray'
messageType : 'actionlib_msgs/msg/GoalStatusArray'
});
statusPublisher.advertise();

Expand All @@ -3106,7 +3106,7 @@
var cancelListener = new Topic({
ros : this.ros,
name : this.serverName + '/cancel',
messageType : 'actionlib_msgs/GoalID'
messageType : 'actionlib_msgs/msg/GoalID'
});

// Track the goals and their status in order to publish status...
Expand Down Expand Up @@ -4435,7 +4435,7 @@
* @param {Object} options
* @param {Ros} options.ros - The ROSLIB.Ros connection handle.
* @param {string} options.name - The topic name, like '/cmd_vel'.
* @param {string} options.messageType - The message type, like 'std_msgs/String'.
* @param {string} options.messageType - The message type, like 'std_msgs/msg/String'.
* @param {string} [options.compression=none] - The type of compression to use, like 'png', 'cbor', or 'cbor-raw'.
* @param {number} [options.throttle_rate=0] - The rate (in ms in between messages) at which to throttle the topics.
* @param {number} [options.queue_size=100] - The queue created at bridge side for re-publishing webtopics.
Expand Down
2 changes: 1 addition & 1 deletion carma-messenger-ui/website/thirdparty/ros/roslib.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var subscribe_bsm = () => {
listenerBSM = new ROSLIB.Topic({
ros: ros,
name: '/bsm_outbound',
messageType: 'cav_msgs/BSM'
messageType: 'carma_v2x_msgs/msg/BSM'
});
listenerBSM.subscribe(function (message) {
if (message.core_data != undefined && message.core_data.latitude != undefined && message.core_data.longitude != undefined) {
Expand Down Expand Up @@ -146,7 +146,7 @@ var subscribe_alert = () => {
listenerAlert = new ROSLIB.Topic({
ros: ros,
name: '/emergency_vehicle_ui_warning',
messageType: 'cav_msgs/UIInstructions'
messageType: 'carma_msgs/msg/UIInstructions'
});
listenerAlert.subscribe(function (message) {
if (message != undefined && message.msg != undefined) {
Expand All @@ -166,7 +166,7 @@ var service_arrive_at_emergency_destination = () => {
var arrive_at_emergency_destination = new ROSLIB.Service({
ros: ros,
name: '/arrived_at_emergency_destination',
serviceType: 'std_srvs/Trigger.srv'
serviceType: 'std_srvs/srv/Trigger.srv'
});

var request = new ROSLIB.ServiceRequest({
Expand Down
6 changes: 3 additions & 3 deletions carma-messenger-ui/website/widgets/eventManagement/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ CarmaJS.WidgetFramework.eventManagement = (function () {
var sendStartBCRequest = new ROSLIB.Service({
ros: ros,
name: '/start_broadcasting_traffic_event',
serviceType: 'cav_srvs/SetTrafficEvent.h'
serviceType: 'carma_msgs/srv/SetTrafficEvent.h'
});

//event UI form
Expand Down Expand Up @@ -187,7 +187,7 @@ CarmaJS.WidgetFramework.eventManagement = (function () {
var listenerMobilityOperation = new ROSLIB.Topic({
ros: ros,
name: '/outgoing_mobility_operation',
messageType: 'cav_msgs/MobilityOperation'
messageType: 'carma_v2x_msgs/msg/MobilityOperation'
});

listenerMobilityOperation.subscribe(function (message) {
Expand Down Expand Up @@ -237,7 +237,7 @@ CarmaJS.WidgetFramework.eventManagement = (function () {
var sendStopBCRequest = new ROSLIB.Service({
ros: ros,
name: '/stop_broadcasting_traffic_event',
serviceType: 'std_srvs/Trigger'
serviceType: 'std_srvs/srv/Trigger'
});
var request = new ROSLIB.ServiceRequest({});
try{
Expand Down
Loading