Comments (7)
I think this is something we could consider for future ROS distros we release into (like melodic), but is unlikely.
But why do you say remapping topics is not future proof? It is a perfectly standard ROS feature and will not introduce any breaking changes to raspicam.
from raspicam_node.
Maybe "not future proof" is not exactly how I should have explained it.
What I meant, is that the launch file now needs to know every topic which is published by the node and remap it. If I was using a namespace, should you add, remove, rename a topic in the future, all the topics will still be correctly mapped.
For raspicam_node, I don't understand why the topics are prefixed with raspicam_node/.
The camera name could have been an option, or nothing at all.
But I perfectly understand the problem, changing this would be a breaking change.
What do you think about adding a parameter like "prefix" with a default value "raspicam_node/" (so that we could set no prefix or set it to the camera name in the launch file.
E.g.: <param
name="prefix" value="$(arg camera_name)/"/>
And then using the namespace offers a lot of flexibility.
Using namespace my_robot would produce topics like: my_robot/my_camera_name/...
from raspicam_node.
That makes a lot of sense, I think a camera prefix parameter with a default of "raspicam_node" makes a lot of sense.
Can you submit a PR with this change?
from raspicam_node.
I just had a look at the code, I thought you were hardcoding the "raspicam_node" in front of the topic names, but you are actually using the node handle with a private namespace for some reason.
ros::init(argc, argv, "raspicam_node");
ros::NodeHandle n("~");
I can't use the prefix parameter I suggested because of that. I need the node handle to get the param and I would need the param to initiate the node handle...
Removing the ~ would do the trick, then users could specify whatever namespace.
E.g: ns="$(arg robot_name)/$(arg camera_name)"
But this would make raspicam_node not backward compatible, unless we put a default namespace in every launch file, but should a user have created his own launch file then it wouldn't work for him anymore.
I could think of other solutions, like removing the tilt and manually prefixing the topics, but that would make the code messy.
It's a pitty that the whole node handle is set as private while most the topics are meant to be publicly accessible over ROS.
from raspicam_node.
I think the best solution is to use a private node handle for parameters, and a global one for topics.
I am not opposed to manually prefixing the topic name with the node name if the camera_prefix is not specified.
from raspicam_node.
Using two different node handles is indeed a good idea.
I started implement the prefix option but it's not a good solution.
The problem is that by setting the topics prefix to "camera_x", we end up with:
Topics example: "/camera_x/image"
Param exaple: "/raspicam_node/the_param"
This doesn't look very intuitive.
The param should be "/camera_x/raspicam_node/the_param" imho, the camera is the main prefix, the param is private and is itself prefixed with the node name.
To achieve that, I ended up with a really simple solution.
Simply introducing a new parameter called "private_topics" (defaults to true).
If the parameter is true:
Topics example: "/raspicam_node/image"
Param example: "/raspicam_node/the_param"
If the parameter is false:
Topics example: "/image"
Param example: "/raspicam_node/the_param"
Then using a namespace on the node makes everything clear.
With namespace "camera_x" and "private_topics" false:
Topics example: "/camera_x/image"
Param example: "/camera_x/raspicam_node/the_param"
Which is probably what we want.
PR coming as soon as I have done some more tests.
from raspicam_node.
#64 PR Created
from raspicam_node.
Related Issues (20)
- raspicam_node image_raw=true don't work on PI2 HOT 3
- Noetic release raspicam_node HOT 28
- Problem in ROS-Noetic - Failed to create camera component - connections are fine. HOT 9
- cv_bridge conversion error: 'Image is wrongly formed HOT 3
- Possible to split combined stereo cameras (Arducam etc)? HOT 1
- no data over network HOT 1
- Video Latency of 3-4 seconds and is it possible to have a raw video/images instead of compressed? HOT 6
- Noetic branch/tag HOT 10
- Update needed? HOT 1
- ROS Noetic Troubleshoot HOT 8
- Enabling RAW HOT 4
- Will this create a point cloud? HOT 1
- 18.04 with ROS melodic - raspicam_node fails HOT 2
- " sudo apt install libraspberrypi-bin" is giving me an error
- Upgrading to noetic branch? HOT 6
- [error] No Disparity images and synchronized triplets received in 'image_view'
- Increasing framerate zooms the video stream HOT 1
- Issue while building raspicam_node package on ros noetic in rpi with 64 bit raspbian OS HOT 7
- Quality checks always false
- Default magni noetic image 6-15.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspicam_node.