Skip to content
Snippets Groups Projects
Commit 29370ed6 authored by finn's avatar finn
Browse files

updated srv def, src dir, readme

parent a4cdac41
Branches
No related merge requests found
#include "rclcpp/rclcpp.hpp"
#include <nav_msgs/msg/path.hpp>
#include "custom_bridge_msgs/srv/custom_service_two.hpp"
class DummyCustomServiceTwo : public rclcpp::Node
{
public:
DummyCustomServiceTwo() : Node("custom_service_topic")
{
service_ = this->create_service<custom_bridge_msgs::srv::CustomServiceTwo>(
"custom_service_topic",
std::bind(&DummyCustomServiceTwo::service_callback, this, std::placeholders::_1, std::placeholders::_2));
}
private:
void service_callback(
const std::shared_ptr<custom_bridge_msgs::srv::CustomServiceTwo::Request> request,
std::shared_ptr<custom_bridge_msgs::srv::CustomServiceTwo::Response> response)
{
RCLCPP_INFO_STREAM(this->get_logger(), "Received CustomServiceTwo request (empty), populating response obj");
response->success = true;
response->reward = 10.0;
response->iterations = 200;
response->path = nav_msgs::msg::Path();
response->path.header.frame_id = "map";
response->path.header.stamp = this->get_clock()->now();
}
rclcpp::Service<custom_bridge_msgs::srv::CustomServiceTwo>::SharedPtr service_;
};
int main(int argc, char *argv[])
{
rclcpp::init(argc, argv);
auto node = std::make_shared<DummyCustomServiceTwo>();
rclcpp::spin(node);
rclcpp::shutdown();
return 0;
}
# decmcts_msgs/StartPlanning
# https://gitlab.com/dst-uts-aerial/decmcts_msgs/-/blob/master/srv/StartPlanning.srv
geometry_msgs/PoseStamped start_pose geometry_msgs/PoseStamped start_pose
float32 horizon_m float32 horizon_m
......
---
bool success
float32 reward
int32 iterations
nav_msgs/Path path
\ No newline at end of file
if [ "$1" = "--help" ] || [ "$1" == "-h" ]; then
echo "custom bridge jammy help menu - build images / run containers"
echo " -b (default) build custom_bridge_jammy using ros2_from_src"
echo " -r start container from default image"
echo ""
echo " --help print help menu"
exit 0
fi
OS="jammy"
image="custom_bridge_example_$OS"
if [ "$1" == "-b" ]; then if [ "$1" == "-b" ]; then
docker build -f custom_bridge.Dockerfile -t custom_bridge_example:jammy . echo "default build"
image+="latest"
docker build -f custom_bridge.Dockerfile -t $image .
exit 0
else
docker run \ elif [ "$1" == "-r" ]; then
-it \ image+="latest"
--rm \
--user "0" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--env DISPLAY=$DISPLAY \
--env NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics \
--env NVIDIA_VISIBLE_DEVICES=all \
--name ros1_bridge_example3 \
ros1_bridge_example_cb:jammy \
"/bin/bash"
else
echo "no options selected"
exit 0
fi fi
name="custom_bridge_example_$OS""_tmp"
docker run \
-it \
--rm \
--user "0" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--env DISPLAY=$DISPLAY \
--env NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics \
--env NVIDIA_VISIBLE_DEVICES=all \
--name $name \
$image \
"/bin/bash"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment