Go to the documentation of this file.
9 #include <rclcpp/rclcpp.hpp>
10 #include <rosgraph_msgs/msg/clock.hpp>
11 #include <rosx_introspection/ros_parser.hpp>
12 #include <websocketpp/common/connection_hdl.hpp>
18 #include <foxglove_bridge/param_utils.hpp>
38 FoxgloveBridge(
const rclcpp::NodeOptions& options = rclcpp::NodeOptions());
45 const std::map<std::string, std::vector<std::string>>& topicNamesAndTypes);
50 const std::map<std::string, std::vector<std::string>>& topicNamesAndTypes);
54 template <
class T1,
class T2>
55 std::size_t
operator()(
const std::pair<T1, T2>& pair)
const {
56 return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
60 std::unique_ptr<foxglove::ServerInterface<ConnectionHandle>>
_server;
67 std::unordered_map<foxglove::ChannelId, foxglove::ChannelWithoutId>
_advertisedTopics;
69 std::unordered_map<foxglove::ChannelId, SubscriptionsByClient>
_subscriptions;
71 std::unordered_map<foxglove::ServiceId, GenericClient::SharedPtr>
_serviceClients;
88 std::unordered_map<std::string, std::shared_ptr<RosMsgParser::Parser>>
_jsonParsers;
103 void setParameters(
const std::vector<foxglove::Parameter>& parameters,
106 void getParameters(
const std::vector<std::string>& parameters,
117 std::shared_ptr<const rclcpp::SerializedMessage> msg);
bool hasCapability(const std::string &capability)
std::map< ConnectionHandle, ros::Subscriber, std::owner_less<> > SubscriptionsByClient
std::unordered_map< foxglove::ChannelId, foxglove::ChannelWithoutId > _advertisedTopics
std::unique_ptr< std::thread > _rosgraphPollThread
websocketpp::connection_hdl ConnectionHandle
std::vector< std::regex > _assetUriAllowlistPatterns
void clientAdvertise(const foxglove::ClientAdvertisement &channel, ConnectionHandle clientHandle)
std::unordered_map< foxglove::ServiceId, foxglove::ServiceWithoutId > _advertisedServices
std::vector< std::regex > _serviceWhitelistPatterns
std::pair< std::string, std::string > TopicAndDatatype
std::shared_ptr< ParameterInterface > _paramInterface
std::unique_ptr< foxglove::CallbackQueue > _fetchAssetQueue
void updateAdvertisedServices()
std::size_t operator()(const std::pair< T1, T2 > &pair) const
rclcpp::GenericSubscription::SharedPtr Subscription
ParameterSubscriptionOperation
void clientMessage(const foxglove::ClientMessage &clientMsg, ConnectionHandle clientHandle)
std::atomic< bool > _subscribeGraphUpdates
std::unordered_map< foxglove::ChannelId, SubscriptionsByClient > _subscriptions
std::mutex _clientAdvertisementsMutex
void subscribe(foxglove::ChannelId channelId, ConnectionHandle clientHandle)
std::vector< std::string > _capabilities
virtual ~FoxgloveBridge()
void rosgraphPollThread()
PublicationsByClient _clientAdvertisedTopics
std::map< ConnectionHandle, ClientPublications, std::owner_less<> > PublicationsByClient
std::atomic< bool > _shuttingDown
std::unordered_map< std::string, std::shared_ptr< RosMsgParser::Parser > > _jsonParsers
void fetchAsset(const std::string &uri, uint32_t requestId, ConnectionHandle clientHandle)
rclcpp::CallbackGroup::SharedPtr _servicesCallbackGroup
constexpr int64_t DEFAULT_MIN_QOS_DEPTH
void unsubscribe(foxglove::ChannelId channelId, ConnectionHandle clientHandle)
void updateAdvertisedTopics()
void getParameters(const std::vector< std::string > ¶meters, const std::optional< std::string > &requestId, ConnectionHandle hdl)
void parameterUpdates(XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result)
void subscribeParameters(const std::vector< std::string > ¶meters, foxglove::ParameterSubscriptionOperation op, ConnectionHandle)
void setParameters(const std::vector< foxglove::Parameter > ¶meters, const std::optional< std::string > &requestId, ConnectionHandle hdl)
constexpr int64_t DEFAULT_MAX_QOS_DEPTH
std::mutex _servicesMutex
rclcpp::GenericPublisher::SharedPtr Publication
void subscribeConnectionGraph(bool subscribe)
std::vector< std::regex > _bestEffortQosTopicWhiteListPatterns
void serviceRequest(const foxglove::ServiceRequest &request, ConnectionHandle clientHandle)
rclcpp::CallbackGroup::SharedPtr _clientPublishCallbackGroup
rclcpp::CallbackGroup::SharedPtr _subscriptionCallbackGroup
void logHandler(foxglove::WebSocketLogLevel level, char const *msg)
void updateConnectionGraph(const std::map< std::string, std::vector< std::string >> &topicNamesAndTypes)
std::shared_ptr< rclcpp::Subscription< rosgraph_msgs::msg::Clock > > _clockSubscription
std::mutex _subscriptionsMutex
std::vector< std::regex > _topicWhitelistPatterns
void rosMessageHandler(const foxglove::ChannelId channelId, ConnectionHandle clientHandle, const ros::MessageEvent< ros_babel_fish::BabelFishMessage const > &msgEvent)
std::unordered_map< foxglove::ClientChannelId, ros::Publisher > ClientPublications
void clientUnadvertise(foxglove::ClientChannelId channelId, ConnectionHandle clientHandle)
std::unique_ptr< foxglove::ServerInterface< ConnectionHandle > > _server
std::unordered_map< foxglove::ServiceId, GenericClient::SharedPtr > _serviceClients
foxglove::MessageDefinitionCache _messageDefinitionCache
foxglove_bridge
Author(s): Foxglove
autogenerated on Tue May 20 2025 02:34:26