      // Save the pose data for the next cycle
      odomOld.pose.pose.position.x = odomNew.pose.pose.position.x;
      odomOld.pose.pose.position.y = odomNew.pose.pose.position.y;
      odomOld.pose.pose.orientation.z = odomNew.pose.pose.orientation.z;
      odomOld.header.stamp = odomNew.header.stamp;

      // Publish the odometry message
      odom_data_pub.publish(odomNew);
    }

    int main(int argc, char **argv) {

      // Set the data fields of the odometry message
      odomNew.header.frame_id = "odom";
      odomNew.pose.pose.position.z = 0;
      odomNew.pose.pose.orientation.x = 0;
      odomNew.pose.pose.orientation.y = 0;
      odomNew.twist.twist.linear.x = 0;
      odomNew.twist.twist.linear.y = 0;
      odomNew.twist.twist.linear.z = 0;
      odomNew.twist.twist.angular.x = 0;
      odomNew.twist.twist.angular.y = 0;
      odomNew.twist.twist.angular.z = 0;
      odomOld.pose.pose.position.x = initialX;
      odomOld.pose.pose.position.y = initialY;
      odomOld.pose.pose.orientation.z = initialTheta;

      // Launch ROS and create a node
      ros::init(argc, argv, "ekf_odom_pub");
      ros::NodeHandle node;

      // Subscribe to ROS topics
      ros::Subscriber subForRightCounts = node.subscribe("right_ticks", 100, Calc_Right, ros::TransportHints().tcpNoDelay());
      ros::Subscriber subForLeftCounts = node.subscribe("left_ticks", 100, Calc_Left, ros::TransportHints().tcpNoDelay());
      ros::Subscriber subInitialPose = node.subscribe("initial_2d", 1, set_initial_2d);

      // Publisher of simple odom message where orientation.z is an euler angle
      odom_data_pub = node.advertise<nav_msgs::Odometry>("odom_data_euler", 100);

      // Publisher of full odom message where orientation is quaternion


###  [ Royals by Lorde – 3-string Open G “GDG”– Tablature and Chords for Cigar
Box Guitar
](////cigar1191.rssing.com/chan-66583770/article5.html#c66583770a5i1448705673)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle21-live.html
"Article Support")


July 2, 2014, 5:29 am


[ ![Very Hungry Caterpillar™ Shirt: World of Eric Carle™+ Little Goodall
by...](//i.etsystatic.com/6018612/r/il/7591e4/3868173454/il_570xN.3868173454_gxfr.jpg)
](////cryptomnesia.rssing.com/chan-1183730/article16627.html#c1183730a16627i1139077293)


[ ↂ
](////electro404.rssing.com/chan-13553321/article484.html#c13553321a484i592237786
"PANASONIC SC AKX50LB - CD Stereo system - Power Amp - Main power SMPS -
Schematic \(Circuit Diagram\) - C1BA00000497 \(Power Amp IC\) -\[TDA 8950J\]
")


[ ](javascript:; "Like") 0


[ ](//question1970.rssing.com/chan-34075453/all_p1.html "older") Page 1  Page
2  Page 3  Page 4  [ ](//question1970.rssing.com/chan-34075453/all_p3.html
"newer")


code)

  42. ![](https://0.gravatar.com/avatar/9e30405458e3b0e25736ed83f61c341ced364b5c831d36433ec5bc79ef4c3ee7?s=48&d=identicon&r=G) **[ Bret Kuhns ](http://gravatar.com/bkuhns) ** says:

[ 2013-06-05 at 2:42 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


Hello all, I was following the tutorial here:
http://wiki.ros.org/xacro#Building_from_CMakeLists.txt to automatically build
urdf files from CMakeLists.txt, but I would additionally wish to create the
files into a custom location, and could not make it work by myself... I tried
setting the RUNTIME_OUTPUT_DIRECTORY but it did not have any effect.
Furthermore, I don't think it is the way forward as I want the urdf files in a
separate location and everything else built from the CMakeLists.txt in their
respective directories. Is there a way to modify the aforementioned tutorial
to create a custom directory for the urdf files? Thank you for your time, A.K.


This project has a number of real-world applications:


      <!-- Wheel Odometry Publisher -->
      <!-- Subscribe: /right_ticks, /left_ticks, /initial_2d -->
      <!-- Publish: /odom_data_euler, /odom_data_quat -->
      <node pkg="localization_data_pub" type="ekf_odom_pub" name="ekf_odom_pub">
      </node>


Write the following code inside the file, then save and close it. I won’t go
into the code in detail, but I added a lot of comments so you can understand
what is going on at each step. All you need to change at the values of the
variables to fit your robot. Leave everything else as-is.


August 13, 2014, 5:50 am


![Noise Industries FxFactory Pro 3.0.2 \[MAC\]](//www.techwench.com/wp-
content/uploads/2010/11/Noise-Industries-FxFactory-Pro-2.jpg)


  * ` Topic ` : Selects the odometry topic ` /zed/zed_node/odom `
  * ` Unreliable ` : Check this to reduce the latency of the messages
  * ` Position tolerance ` and ` Angle tolerance ` : set both to ` 0 ` to be sure to visualize all positional data
  * ` Keep ` : Set to the number of messages to visualize at a time
  * ` Shape ` : You can visualize odometry information as an arrow pointing in the direction of the ` X ` axis, or as a three ` Axes ` frame. Both shapes can be resized to your preference


###  [ Murder in Australia: 2010
](////murder540.rssing.com/chan-6412619/article1.html#c6412619a1i1155785771)


91 Solution: Smart Pointer Parameters  ”

  1. Pingback: [ Fixed: C++ – passing references to std::shared_ptr or boost::shared_ptr


comment-11792)

Hi everybody,
I came back o read again this post because I was in front of a dilema and I
was wondering what is the best way to express it.

I had created a std:vector and I was going to pass it to a function

std:vector widgetList;
myWidgetManager.addWidgetList(widgetList);
[\code]

To me addWidgetList is a sink, the object will take the ownership of the
vector. So I tough, I should pass a std:unique_ptr<std::vector>, first it
start to be a mouthful to write and my object is actually on the stack.

In this guru you don’t only talk about smart pointers but also on when/how to
pass argument to functions. To me this situation is like c) the function is a
sink but for the stack i would express it as std::vector&&.

Would that be a good practice?
thanks
Mani

  20. ![](https://1.gravatar.com/avatar/15fd957a4ab2c9a249d6f8d9daceb90fe25bc313c9a8ad9d47b61a0477ea1b6d?s=48&d=identicon&r=G) **GregM** says:

[ 2013-07-01 at 8:05 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ Copy Share URL ](javascript:;)


#  [ Custom hardware driver
](//question1970.rssing.com/chan-34075453/article32-live.html)


April 8, 2024, 2:19 am


  * [ Home  ](//www.rssing.com/index.php)
    * [ About Us ](//www.rssing.com/about.php)
    * [ Catalog ](//www.rssing.com/catalog.php)
  * [ Search  ](//www.rssing.com/search.php)
  * [ Register RSS  ](//www.rssing.com/register.php)
  * [ Embed RSS  ](//www.rssing.com/embed.php)
    * [ FAQ ](//www.rssing.com/embed.php?a=whe)
    * [ Get Embed Code ](//www.rssing.com/embed.php)
    * [ Example: Default CSS ](//www.rssing.com/embed.php?a=ex1)
    * [ Example: Custom CSS ](//www.rssing.com/embed.php?a=ex2)
    * [ Example: Custom CSS per Embedding ](//www.rssing.com/embed.php?a=ex3)
  * [ Super RSS  ](//www.rssing.com/super.php)
    * [ Usage ](//www.rssing.com/super.php)
    * [ View Latest ](//www.rssing.com/super.php?a=l)
    * [ Create ](//www.rssing.com/super.php?a=crt)


[ _≪_ Previous: Custom hardware driver
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a32 "Previous
Article")


ROS 2 uses the new constructs available with C++11 and C++14, so to bind the
callbacks (a class method in this case) to the ` mPoseSub ` and ` mOdomSub `
objects we use the form


###  [ CALIFORNIA: DUI arrests by Chico Police March 2019
](////arrests130.rssing.com/chan-8670761/article2736.html#c8670761a2736i331208640)


comment-10949)

The template parameters were edited out of my comment above. Should say

        std::optional<Widget&>

every time I say “std::optional”.

Herb, pretty please, find a way to support markdown in comments on your blog!

  52. ![](https://0.gravatar.com/avatar/9e30405458e3b0e25736ed83f61c341ced364b5c831d36433ec5bc79ef4c3ee7?s=48&d=identicon&r=G) **[ Bret Kuhns ](http://bretkuhns.com/) ** says:

[ 2013-06-05 at 8:31 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


October 24, 2014, 8:44 am


Open a new terminal window.


  * [ May 2013 ](https://herbsutter.com/2013/05/) (22)
  * [ April 2013 ](https://herbsutter.com/2013/04/) (2)
  * [ March 2013 ](https://herbsutter.com/2013/03/) (1)
  * [ February 2013 ](https://herbsutter.com/2013/02/) (1)
  * [ January 2013 ](https://herbsutter.com/2013/01/) (3)
  * [ December 2012 ](https://herbsutter.com/2012/12/) (3)
  * [ November 2012 ](https://herbsutter.com/2012/11/) (6)
  * [ October 2012 ](https://herbsutter.com/2012/10/) (5)
  * [ September 2012 ](https://herbsutter.com/2012/09/) (3)
  * [ August 2012 ](https://herbsutter.com/2012/08/) (3)
  * [ July 2012 ](https://herbsutter.com/2012/07/) (1)
  * [ June 2012 ](https://herbsutter.com/2012/06/) (7)
  * [ May 2012 ](https://herbsutter.com/2012/05/) (5)
  * [ April 2012 ](https://herbsutter.com/2012/04/) (17)
  * [ March 2012 ](https://herbsutter.com/2012/03/) (4)
  * [ February 2012 ](https://herbsutter.com/2012/02/) (5)
  * [ January 2012 ](https://herbsutter.com/2012/01/) (7)
  * [ December 2011 ](https://herbsutter.com/2011/12/) (3)
  * [ November 2011 ](https://herbsutter.com/2011/11/) (6)
  * [ October 2011 ](https://herbsutter.com/2011/10/) (10)
  * [ September 2011 ](https://herbsutter.com/2011/09/) (3)
  * [ August 2011 ](https://herbsutter.com/2011/08/) (3)
  * [ July 2011 ](https://herbsutter.com/2011/07/) (2)
  * [ June 2011 ](https://herbsutter.com/2011/06/) (4)
  * [ May 2011 ](https://herbsutter.com/2011/05/) (5)
  * [ April 2011 ](https://herbsutter.com/2011/04/) (3)
  * [ March 2011 ](https://herbsutter.com/2011/03/) (2)
  * [ January 2011 ](https://herbsutter.com/2011/01/) (1)
  * [ December 2010 ](https://herbsutter.com/2010/12/) (2)
  * [ October 2010 ](https://herbsutter.com/2010/10/) (5)
  * [ September 2010 ](https://herbsutter.com/2010/09/) (3)
  * [ August 2010 ](https://herbsutter.com/2010/08/) (2)
  * [ July 2010 ](https://herbsutter.com/2010/07/) (1)
  * [ June 2010 ](https://herbsutter.com/2010/06/) (2)
  * [ May 2010 ](https://herbsutter.com/2010/05/) (5)
  * [ April 2010 ](https://herbsutter.com/2010/04/) (5)
  * [ March 2010 ](https://herbsutter.com/2010/03/) (9)
  * [ February 2010 ](https://herbsutter.com/2010/02/) (2)
  * [ January 2010 ](https://herbsutter.com/2010/01/) (3)
  * [ December 2009 ](https://herbsutter.com/2009/12/) (1)


/android_gingerbread/ros_text_view_speed missing rosnode info
/android_gingerbread/ros_text_view_speed_limited: Subscriptions: *
/function_drivinggoal_desired [ros_messages/function_drivinggoal] contacting
node http://192.168.0.199:44133/ ... Pid: 2328 Connections: * topic: /rosout *
to: /rosout * direction: outbound * transport: TCPROS * topic:
/function_drivinggoal_desired * to: /play_1408345524838586534
(http://192.168.0.95:37820/) * direction: inbound * transport: TCPROS rosnode
info /android_gingerbread/ros_text_view_speed: Subscriptions: *
/veh_vehicle_model_dynamics [ros_messages/vehicle_model_dynamics] contacting
node http://192.168.0.199:48483/ ... Pid: 2744 Connections: * topic: /rosout *
to: /rosout * direction: outbound * transport: TCPROS * topic:
/veh_vehicle_model_dynamics * to: /play_1408345524838586534
(http://192.168.0.95:37820/) * direction: inbound * transport: TCPROS could
the error come from the name of my custom_msgs could rebuilding the jar as
"ros_messages" solve the problem?


ROS2 Humble GoalResponseCallback:


###  [ People's Blog • Germany Bans the Number 44
](////political6769.rssing.com/chan-78425830/article66.html#c78425830a66i1994484930)


[ _≫_ Next: android custom messages - Subscriber handshake failed - Message
types don't match
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a26 "Next
Article")


I have a messages package that defines several custom messages based on ROS
messages. I then have messages that use my custom messages to make other
message types. For example: # Base.msg float64 data And then I use Base to
make another message type # BaseVector.msg Base[] vector_of_data I find that
when I run $ rosrun rosserial_arduino make_libraries . Headers cannot be made
for messages that are made of custom messages, like BaseVector.msg. I get the
following error: *** Warning, failed to generate libraries for the following
packages: *** my_custom_messages Can this problem be fixed or do I need to
remake all my messages without using custom messages to define them? Thank you
for your help! EDIT: My message package CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3) project(relative_nav_msgs)
find_package(catkin REQUIRED COMPONENTS std_msgs sensor_msgs geometry_msgs
nav_msgs message_generation) ## Generate messages in the 'msg' folder
add_message_files( FILES FilterState.msg DesiredVector.msg DesiredState.msg
Edge.msg NodeInfo.msg VOUpdate.msg Keyframe.msg Command.msg Waypoint.msg
Path.msg Voltage.msg Goal.msg #Optional DEBUG_Controller.msg Snapshot.msg ) ##
Generate added messages and services with any dependencies listed here
generate_messages( DEPENDENCIES std_msgs sensor_msgs geometry_msgs nav_msgs )
catkin_package( # INCLUDE_DIRS include # LIBRARIES relative_nav_msgs #
CATKIN_DEPENDS geometry_msgs nav_msgs std_msgs # DEPENDS system_lib )
include_directories( ${catkin_INCLUDE_DIRS} )


###  Introduction  #


To add the wheel odometry publisher above to a [ ROS launch file
](https://automaticaddison.com/how-to-create-and-execute-ros-launch-files/) ,
you will add the following lines:


[ ](javascript:; "Share Chan")


[ _≪_ Previous: depends on message does not work for my node
](//question1970.rssing.com/chan-34075453/all_p1.html#c34075453a20 "Previous
Article")


If you need help with something, please **[ fill out this form.
](https://automaticaddison.com/contact/) ** Thank you!


I know exactly, why you are getting this error.
**Reason:** The rosject uses ` Foxy ` as ROS2 version while You have learned
ROS2 Basics with ` Humble ` .
There was a major syntax difference in Goal Response Callback function.
So the error is not in the reported line but the function itself!
Handling these errors requires some finesse which you will develop as you
code.


[ Remove ADS ](//www.rssing.com/account.php?r=27)


comment-25046)

Would defining good_sync() in your example as:

        void good_sink( unique_ptr<widget>&& p );

prevent an extra std::unique_ptr from being generated (upon entry of the
method), while enforcing the same semantics as the pass-by-value method
declaration? The std::move() would do nothing to the std::unique_ptr passed
into the function until the function itself actually “sunk” :) it, where as
pass-by-value moves it immediately into a temporary.

What do you think about that approach?

  6. ![](https://1.gravatar.com/avatar/7a7484209612183b0de74cc6f42f1e76cbd0b3ac20bee3aeef8eda2e3cdf6ccb?s=48&d=identicon&r=G) **[ kerjasambilandirumah.net ](http://kerjasambilandirumah.net) ** says:

[ 2014-05-09 at 5:18 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


2 (correctness) – even without changing the state of the calling
function, passing a shared_ptr by reference can be hazardous if the function
is able to remove the shared_ptr reference that was passed to it. A trivial
case is below (results in a crash), but one can easily imagine a less trivial
case — say, if the function were to run some validation on the data passed to
it which could result in a new instantiation of that data…

        struct IntArrayContainer
    {
    	shared_ptr<vector<int>> mIntArray;
    };

    IntArrayContainer* gIntArrayContainer;

    int GetFirstValueFrom(shared_ptr<vector<int>>& intArray)
    {
    	delete gIntArrayContainer;
    	return (*intArray)[0];
    }

    void main()
    {
    	gIntArrayContainer = new IntArrayContainer();
    	gIntArrayContainer->mIntArray = shared_ptr<vector<int>>(new vector<int>(1, 1));
    	printf("First: %d\n", GetFirstValueFrom(gIntArrayContainer->mIntArray));
    }

  29. ![](https://graph.facebook.com/1584648256/picture?type=large&_md5=963e9020506d0139d2ccd78ca3926106) **[ Kamil Rojewski ](http://www.facebook.com/kamil.rojewski) ** says:

[ 2013-06-06 at 1:53 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


  (e) Passing shared_ptr by value implies taking shared ownership.

    void f( shared_ptr<widget> );   (e)

As we saw in


[ ↂ
](////heroturko111.rssing.com/chan-16832457/article82.html#c16832457a82i1004730930
"Noise Industries FxFactory Pro 3.0.2 \[MAC\]")


Hi, I want to have one callback function for subscription of two topics. I
read online
[here](http://wiki.ros.org/message_filters?distro=hydro#Time_Synchronizer)
that I can use the message_filters library to time synchronize the topics. In
my ROS node when I use the Image and Camera_info topic as suggested in the
example code below, I get no errors. message_filters::Subscriber  image_sub(n,
"image", 1); message_filters::Subscriber  info_sub(n, "camera_info", 1);
TimeSynchronizer  sync(image_sub, info_sub, 10);
sync.registerCallback(boost::bind(&callback, _1, _2)); But when I replace the
Image and CameraInfo message formats with custom messages, as shown below, I
get a lot of errors. I am attaching the
message_filters::Subscriber<:featurebarray> fea_sub(n, "Feature", 1);
message_filters::Subscriber<:odometry> odo_sub(n, "odom", 1);
message_filters::TimeSynchronizer<:featurebarray nav_msgs::odometry>
sync(fea_sub, odo_sub, 10);
sync.registerCallback(boost::bind(&FeaturesReceived, _1, _2)); **Is
message_filters time synchronizer only applicable to certain message formats
?** The error message I get it very long. I am pasting it here: In file
included from /opt/ros/hydro/include/message_filters/time_synchronizer.h:39:0,
from /home/quadrotor/catkin_ws/src/coop_est/src/coop_node.cpp:15:
/opt/ros/hydro/include/message_filters/sync_policies/exact_time.h: In member
function ‘void message_filters::sync_policies::ExactTime  ::add(const typename
boost::mpl::at_c  ::Events, i>::type&) [with int i = 0, M0 =
coop_est::FeatureBArray_<:allocator>>, M1 = nav_msgs::Odometry_<:allocator>>,
M2 = message_filters::NullType, M3 = message_filters::NullType, M4 =
message_filters::NullType, M5 = message_filters::NullType, M6 =
message_filters::NullType, M7 = message_filters::NullType, M8 =
message_filters::NullType, typename boost::mpl::at_c  ::Events, i>::type =
ros::MessageEvent  >>]’:
/opt/ros/hydro/include/message_filters/synchronizer.h:358:5: instantiated from
‘void message_filters::Synchronizer  ::cb(const typename boost::mpl::at_c
::type&) [with int i = 0, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>, typename
boost::mpl::at_c  ::type = ros::MessageEvent  >>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:290:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&, F3&, F4&,


[ RSSing>> ](//www.rssing.com/index.php) [ Latest
](//www.rssing.com/index.php?l=l) [ Popular ](//www.rssing.com/index.php?l=p)
[ Top Rated ](//www.rssing.com/index.php?l=r) [ Trending
](//www.rssing.com/index.php?l=t)


[ Search ](javascript:;)


###  [ Za Pakhtoon Yum: A mind-altering foray into Pukhtun life and culture
](////drama1031.rssing.com/chan-27446141/article21.html#c27446141a21i856785604)


’s out[2] and ref[3]. That way
the mutability is visible at the call site, there are no raw pointers in user
code, and there is no question as to whether the referenced variable needs to
be initialised or not (because it only has to be initialised for an inout
variable).

[1] [ https://gist.github.com/LeszekSwirski/3028820
](https://gist.github.com/LeszekSwirski/3028820)
[2] [ http://msdn.microsoft.com/en-us/library/ee332485.aspx
](http://msdn.microsoft.com/en-us/library/ee332485.aspx)
[3] [ http://msdn.microsoft.com/en-us/library/14akc2c7.aspx
](http://msdn.microsoft.com/en-us/library/14akc2c7.aspx)

  40. ![](https://2.gravatar.com/avatar/b7a69c0c0ae3972122cf80c87df58096f4acb38808d05d6cd616e357bcadf7bd?s=48&d=identicon&r=G) **Brian M** says:

[ 2013-06-05 at 3:50 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


#  [ Documentation on writing hardware drivers
](//question1970.rssing.com/chan-34075453/article39-live.html)


The two callbacks are very similar; the only difference is that ` poseCallback
` receives messages of type ` geometry_msgs/PoseStamped ` and ` odomCallback `
receives messages of type ` nav_msgs/Odometry ` . These are similar but not
identical. However, the information extracted by the two topics is the same:
camera position and camera orientation.


  * **/right_ticks** : [ **Tick counts** ](https://automaticaddison.com/calculate-pulses-per-revolution-for-a-dc-motor-with-encoder/) from the right motor [ encoder ](https://en.wikipedia.org/wiki/Rotary_encoder) ( [ std_msgs/Int16 ](http://docs.ros.org/en/api/std_msgs/html/msg/Int16.html) )
  * **/left_ticks** : Tick counts from the left motor encoder (std_msgs/Int16)
  * **/initial_2d** : The initial position and orientation of the robot.( [ geometry_msgs/PoseStamped ](http://docs.ros.org/en/api/geometry_msgs/html/msg/PoseStamped.html) )


comment-14623)

Please extend this article with the following two examples explained:
void f( weak_ptr ); (e)
void f( weak_ptr& ); (f)

I know some engineers that believe this is the best way to pass widget to
methods that don’t take ownership.

  8. ![](https://1.gravatar.com/avatar/737da493c3292a44f71b1c8360c7ba6254a8e2b7951ea889e165a7a2794872b2?s=48&d=identicon&r=G) **[ Bartosz Milewski ](http://www.relisoft.com) ** says:

[ 2014-01-06 at 9:36 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, F4 =
message_filters::NullFilter<:nulltype>, F5 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:261:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&, F3&, F4&)
[with F0 = message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, F4 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:254:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&, F3&) [with
F0 = message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:247:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&) [with F0 =
message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,


For more information about QoS compatibility, refer to the [ ZED node guide
](https://www.stereolabs.com/docs/ros2/zed-node/#published-topics)


comment-10998)

As I noted in a comment on the question, there is another use for (d). Some
functions may choose to either take or not take ownership of an object by
criteria to be decided at run-time, perhaps by inspecting the object itself.
Think of a “chain of responsibility” pattern, for example.

  32. ![](https://0.gravatar.com/avatar/928f5830f12d8977791539452bfc25c92912322476f0725253697ee1c45ce036?s=48&d=identicon&r=G) **[ Herb Sutter ](http://www.herbsutter.com) ** says:

[ 2013-06-05 at 9:15 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


It continues with:


[ _≫_ Next: Append data to vector3[] array - custom message
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a37 "Next
Article")


call-by-reference)
“My personal style is to use a pointer when I want to modify an object because
in some contexts that makes it easier to spot that a modification is
possible.”
@Herb, would it be fair to say you disagree with the above style? :)

  35. ![](https://0.gravatar.com/avatar/66f79d8eeace7255925750593cf4e64f24063a6d5258ae4ea2c5419262ca3dce?s=48&d=identicon&r=G) **Jon** says:

[ 2013-06-05 at 5:37 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


comment-11063)

@Jon: That’s probably a rare case but I think you’re right it’s worth calling
out. Added, thanks.

  27. ![](https://0.gravatar.com/avatar/66f79d8eeace7255925750593cf4e64f24063a6d5258ae4ea2c5419262ca3dce?s=48&d=identicon&r=G) **Jon** says:

[ 2013-06-06 at 5:26 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


  3\. A colleague is writing a function f that takes an existing object of
type widget as a required input-only parameter, and trying to decide among the
following basic ways to take the parameter (omitting const). Under what
circumstances is each appropriate? Explain your answer, including where const
should or should not be added anywhere in the parameter type.


comment-10983)

What worries me here is the number of ways and opinions going on – with real
world coders I just wonder what would be used in the average non-guru shop or
guru populated shop for that matter! The use of the raw pointer does have its
simplicity in this case and the only really good argument against it is in a
sink function, even then a suitable name such as ProcessAndDelete might
suffice. If a coder can’t pick up on that, then we are probably doomed anyway!

Beginning to think we are now in no-mans land with c++, it’s getting way too
complicated, after all its only a tool to achieve an end. Maybe we need a more
intelligent compiler that can make a lot of these ‘guru’ decisions for the
average coder. It should not beyond the ability of a compiler to have a
autoptr mk2 that is compiled into the most efficient type for the job. Be like
having Herb or Meyers standing behind you :)

  41. ![](https://0.gravatar.com/avatar/f9c5119305afcc94a4d7e8338944eb988b5749999045411acefa7ac9eae9a622?s=48&d=identicon&r=G) **mttpd** says:

[ 2013-06-05 at 3:27 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


That’s it! Keep building!


Here is a simple trick to understand long error outputs: It is usually the
reference to the first line of error that has the actual bug. The remaining
errors are caused because of the first error.


###  [ Meet Peter Nygard Girlfriends & Children
](////dailyentertainmentnews33.rssing.com/chan-41166720/article94.html#c41166720a94i1969999888)


comment-10991)

@Leszek Swirski: Have you considered submitting your header to boost?

Having mutability visible at the call site is useful.
Eg Bjarne Stroustrup: [ http://www.stroustrup.com/bs_faq2.html


[ ![People's Blog • First Pictures of the Eclipse ! !
!](//thepeoplescube.com/red/download/file.php?id=57243&sid=d61d4527be50ef499d8f3761aad83688)
](////satire6144.rssing.com/chan-78334822/article122.html#c78334822a122i1295535114)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle29-live.html
"Article Support")


URL:


comment-10997)

@Jon: This is better in the case where you do get an rvalue, and the default
guidance to “pass by value then move as needed” doesn’t apply just to smart
pointers but to any type that’s cheaper to move than copy. And yes, my opinion
has changed. Basically that came from paranoia about a different optimization
that doesn’t apply to standard C++ code (something we encountered designing
C++/CX that can apply to the underlying implementation of refcounted ^’s but I
now realize doesn’t apply to shared_ptrs in normal C++ code).

  33. ![](https://2.gravatar.com/avatar/28422b7f6e7f07f995b4a9babaa2b8f29ef273bc230526a0e931e5d68bde8dce?s=48&d=identicon&r=G) **[ jlehrer ](http://www.lehrerfamily.com/) ** says:

[ 2013-06-05 at 6:16 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle23-live.html
"Article Support")


April 8, 2024, 8:41 am


  JG Question

1\. What are the _performance_ implications of the following function
declaration? Explain.

    void f( shared_ptr<widget> );


![Calgary Hells Angels implicated in another
fraud](//2.bp.blogspot.com/-qpKtSMmZQDE/VDeynZXmedI/AAAAAAAAV04/yx0T_VyHhsc/s320/IMG_60691061533681.jpeg)


1?
Explain with clear examples.

3\. A colleague is writing a function  f  that takes an existing object of
type  widget  as a required input-only parameter, and trying to decide among
the following basic ways to take the parameter (omitting  const  ):

    void f( widget* );              (a)
    void f( widget& );              (b)
    void f( unique_ptr<widget> );   (c)
    void f( unique_ptr<widget>& );  (d)
    void f( shared_ptr<widget> );   (e)
    void f( shared_ptr<widget>& );  (f)

Under what circumstances is each appropriate? Explain your answer, including
where  const  should or should not be added anywhere in the parameter type.

(There are other ways to pass the parameter, but we will consider only the
ones shown above.)


[
![Logo](https://cdn.sanity.io/images/s18ewfw4/production/3534345dbdb3bbf9ec698e5024d0c4f72eeb30f5-149x20.svg)
](https://www.stereolabs.com)


[ _≫_ Next: How to set custom location for urdf files created from xacro with
cmake? ](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a40
"Next Article")


comment-25739)

Why are we making pointers even more complicated to teach and learn? Somehow
we have figured out a way to make this more difficult to properly teach in a
consistent manner and this makes learning exponentially harder.

Maybe it’s time for a fundamental change. Let’s not think about pointers,
references, and smart pointers. Let’s think about what we are really trying to
do in these scenarios and bake the solutions into the language using
different, more meaningful, names for those scenarios.

I know, I know… what about legacy code. Figure it out. This is supposed to be
a means to an end. I have better things to do. Don’t you?

  4. ![](https://1.gravatar.com/avatar/15fd957a4ab2c9a249d6f8d9daceb90fe25bc313c9a8ad9d47b61a0477ea1b6d?s=48&d=identicon&r=G) **Greg Marr** says:

[ 2014-08-22 at 1:06 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ ](javascript:; "Like") 0


The publisher will **publish odometry data** to the following topics:


[ _≪_ Previous: compile twice to see custom message
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a22 "Previous
Article")


[ How to call action with an empty goal? ](https://get-
help.robotigniteacademy.com/t/how-to-call-action-with-an-empty-goal/23944/9)


  * [ GStreamer  ](https://www.stereolabs.com/docs/gstreamer/) [ Camera Source ](https://www.stereolabs.com/docs/gstreamer/zed-camera-source/) [ Metadata ](https://www.stereolabs.com/docs/gstreamer/zed-metadata/) [ Demuxer ](https://www.stereolabs.com/docs/gstreamer/zed-demux/) [ Sensors CSV Sink ](https://www.stereolabs.com/docs/gstreamer/zed-data-csv-sink/) [ Object Detection Overlay ](https://www.stereolabs.com/docs/gstreamer/zed-od-overlay/) [ Data muxer ](https://www.stereolabs.com/docs/gstreamer/zed-datamux/) [ RTSP Server ](https://www.stereolabs.com/docs/gstreamer/rtsp-server/)
  * [ Matlab  ](https://www.stereolabs.com/docs/matlab/)
  * [ OpenNI2  ](https://www.stereolabs.com/docs/openni2/)


[ bayodesegun  ](https://get-help.theconstruct.ai/u/bayodesegun) March 15,
2023, 2:15pm  4


            this->angular_vel = 0.1;
            this->dist_tol = 0.02;
            this->angle_tol = 3.0*M_PI/180;
            this->timer_period = 0.5;

        }

        bool is_goal_done() const
        {
            return this->goal_done_;
        }

        void send_goal()
        {
            using namespace std::placeholders;

            this->action_client_timer_->cancel();

            this->goal_done_ = false;

            if (!this->client_ptr_) {
                RCLCPP_ERROR(this->get_logger(), "Action client not initialized");
            }

            if (!this->client_ptr_->wait_for_action_server(std::chrono::seconds(10))) {
                RCLCPP_ERROR(this->get_logger(), "Action server not available after waiting");
                this->goal_done_ = true;
                return;
            }

            auto goal_msg = OdomRecord::Goal();

            RCLCPP_INFO(this->get_logger(), "Sending goal");

            auto send_goal_options = rclcpp_action::Client<OdomRecord>::SendGoalOptions();

            send_goal_options.goal_response_callback =
            std::bind(&WallFollower::goal_response_callback, this, _1);

            send_goal_options.feedback_callback =


[ Claim  ](javascript:; "Claim Chan")


![Za Pakhtoon Yum: A mind-altering foray into Pukhtun life and
culture](//blogs.tribune.com.pk/application/../wp-
content/uploads/2014/10/24552-zpy-1414239961-635-160x120.jpg)


![Good Will Hunting 1997 Dual Audio 720p BRRip \[Hindi – English\]
ESubs](//i0.wp.com/2.bp.blogspot.com/-BNeRHGE6vos/V1gESmKp3AI/AAAAAAAADVM/SBOnE2K617oqzf7FLZQMMtFmvLYnIJqegCLcB/s1600/Good%2BWill%2BHunting%2B%25281997%2529%2BBluray.jpg?resize=350%2C450&ssl=1)


      odom_data_pub_quat = node.advertise<nav_msgs::Odometry>("odom_data_quat", 100);

      ros::Rate loop_rate(30);

      while(ros::ok()) {

        if(initialPoseRecieved) {
          update_odom();
          publish_quat();
        }
        ros::spinOnce();
        loop_rate.sleep();
      }

      return 0;
    }


Open another terminal window, and launch the node.


[ _≪_ Previous: Declare array of custom type
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a24 "Previous
Article")


A component named ` MinimalPoseOdomSubscriber ` is created subclassing the ROS
2 object ` rclcpp::Node ` .


            mOdomSub = create_subscription<nav_msgs::msg::Odometry>(
                        "odom", qos,
                        std::bind(&MinimalPoseOdomSubscriber::odomCallback, this, _1) );
        }

    protected:
        void poseCallback(const geometry_msgs::msg::PoseStamped::SharedPtr msg) {
            // Camera position in map frame
            double tx = msg->pose.position.x;
            double ty = msg->pose.position.y;
            double tz = msg->pose.position.z;

            // Orientation quaternion
            tf2::Quaternion q(
                        msg->pose.orientation.x,
                        msg->pose.orientation.y,
                        msg->pose.orientation.z,
                        msg->pose.orientation.w);

            // 3x3 Rotation matrix from quaternion
            tf2::Matrix3x3 m(q);

            // Roll Pitch and Yaw from rotation matrix
            double roll, pitch, yaw;
            m.getRPY(roll, pitch, yaw);

            // Output the measure
            RCLCPP_INFO(get_logger(), "Received pose in '%s' frame : X: %.2f Y: %.2f Z: %.2f - R: %.2f P: %.2f Y: %.2f - Timestamp: %u.%u sec ",
                     msg->header.frame_id.c_str(),
                     tx, ty, tz,
                     roll * RAD2DEG, pitch * RAD2DEG, yaw * RAD2DEG,
                        msg->header.stamp.sec,msg->header.stamp.nanosec);
        }

        void odomCallback(const nav_msgs::msg::Odometry::SharedPtr msg) {
            // Camera position in map frame
            double tx = msg->pose.pose.position.x;
            double ty = msg->pose.pose.position.y;
            double tz = msg->pose.pose.position.z;


![Frequency
Adverbs](//busyteacher.org/uploads/posts/2014-04/thumbs/1396577766_adverbs-of-
frecuency-0.png)


  Follow by email

Email Address:

Subscribe

[ ![](https://herbsutter.files.wordpress.com/2024/03/herb-
cppcon-2021.jpg?w=300) ](https://herbsutter.files.wordpress.com/2024/03/herb-
cppcon-2021.jpg)

I am a software technologist, working at the intersection of programming
language design/UX, people, and high performance code. I've been writing about
programming since 1993, usually about C++ or about concurrency and
parallelism. I've served as the chair of the [ ISO C++ standards committee
](https://isocpp.org/std/the-committee) since 2002, and as the chair of the [
Standard C++ Foundation ](https://isocpp.org/about) since 2012. I'm a software
architect at [ Microsoft ](https://www.microsoft.com/) . This personal website
expresses the opinions of none of those organizations.


It is important that the two subscriptions use a QOS profile compatible with
the QOS profile of the publisher of the topics.


So the error says operator mismatch in the line:
` std::bind(&WallFollower::goal_response_callback, this, _1); ` .


call-by-
reference ](http://www.stroustrup.com/bs_faq2.html


![Me](https://automaticaddison.com/wp-content/uploads/2020/05/addison-
humanoid-ces-2020.jpg)


    /opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp: In instantiation of 'void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >)>; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = 0; MessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; Alloc = std::allocator<void>]':
    /opt/ros/foxy/include/rclcpp/subscription_factory.hpp:97:3:   required from 'rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&,const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<nav_msgs::msg::Odometry_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> > >]'
    /opt/ros/foxy/include/rclcpp/create_subscription.hpp:144:63:   required from 'std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<nav_msgs::msg::Odometry_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> > >]'
    /opt/ros/foxy/include/rclcpp/node_impl.hpp:98:47:   required from 'std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = nav_msgs::msg::Odometry_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<nav_msgs::msg::Odometry_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> >; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<nav_msgs::msg::Odometry_<std::allocator<void> >, std::allocator<void> > >]'
    /home/user/ros2_ws/src/Wall Follower/wall_follower/src/wall_follower_part3.cpp:62:89:   required from here
    /usr/include/c++/9/bits/std_function.h:532:2: note: candidate: 'template<class _Functor> std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes...)>::operator=(std::reference_wrapper<_Functor>) [with _Functor = _Functor; _Res = void; _ArgTypes = {std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >}]'
      532 |  operator=(reference_wrapper<_Functor> __f) noexcept
          |  ^~~~~~~~
    /usr/include/c++/9/bits/std_function.h:532:2: note:   template argument deduction/substitution failed:
    In file included from /opt/ros/foxy/include/rclcpp/subscription_base.hpp:29,
                     from /opt/ros/foxy/include/rclcpp/callback_group.hpp:26,
                     from /opt/ros/foxy/include/rclcpp/any_executable.hpp:20,
                     from /opt/ros/foxy/include/rclcpp/memory_strategy.hpp:24,
                     from /opt/ros/foxy/include/rclcpp/memory_strategies.hpp:18,
                     from /opt/ros/foxy/include/rclcpp/executor_options.hpp:20,
                     from /opt/ros/foxy/include/rclcpp/executor.hpp:33,
                     from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:26,
                     from /opt/ros/foxy/include/rclcpp/executors.hpp:21,
                     from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
                     from /home/user/ros2_ws/src/Wall Follower/wall_follower/src/wall_follower_part3.cpp:5:
    /opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:85:26: note:   'std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<nav_msgs::msg::Odometry_<std::allocator<void> > >)>' is not derived from 'std::reference_wrapper<_Tp>'
       85 |     shared_ptr_callback_ = callback;
          |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    /opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp: In instantiation of 'void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<sensor_msgs::msg::LaserScan_<std::allocator<void> >>)>; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = 0; MessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; Alloc = std::allocator<void>]':
    /opt/ros/foxy/include/rclcpp/subscription_factory.hpp:97:3:   required from 'rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&,const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<sensor_msgs::msg::LaserScan_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<sensor_msgs::msg::LaserScan_<std::allocator<void>> >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> > >]'
    /opt/ros/foxy/include/rclcpp/create_subscription.hpp:144:63:   required from 'std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<sensor_msgs::msg::LaserScan_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<sensor_msgs::msg::LaserScan_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> > >]'
    /opt/ros/foxy/include/rclcpp/node_impl.hpp:98:47:   required from 'std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; CallbackT = std::_Bind<void (WallFollower::*(WallFollower*, std::_Placeholder<7>))(std::shared_ptr<sensor_msgs::msg::LaserScan_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; CallbackMessageT = sensor_msgs::msg::LaserScan_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<sensor_msgs::msg::LaserScan_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> >; std::string = std::__cxx11::basic_string<char>; typenameMessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<sensor_msgs::msg::LaserScan_<std::allocator<void> >, std::allocator<void> > >]'


[ ![First Pictures of the Eclipse ! !
!](//thepeoplescube.com/red/download/file.php?id=57243&sid=5311a0068099bb708e6eae6fd0456e59)
](////political6691.rssing.com/chan-78391714/article69.html#c78391714a69i1437484910)


[ girishkumar.kannan  ](https://get-help.theconstruct.ai/u/girishkumar.kannan)
March 16, 2023, 4:44am  7


This topic was automatically closed 5 days after the last reply. New replies
are no longer allowed.


[ ](javascript:; "Like") 0


comment-10936)

Section 1 of this says that incrementing the reference count of a shared_ptr
can be optimized to a single read-modify-write without guards, while a
decrement must have guards. I’d love to see a link to an explanation of this
statement. I thought that if one writer needs a synchronization primitive then
all writers needed that primitive.

  56. ![](https://0.gravatar.com/avatar/f9c5119305afcc94a4d7e8338944eb988b5749999045411acefa7ac9eae9a622?s=48&d=identicon&r=G) **mttpd** says:

[ 2013-06-05 at 7:03 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


    cd ~/catkin_ws/src/jetson_nano_bot/localization_data_pub/

    gedit CMakeLists.txt


comment-11005)

@Jon: I have considered it, but a similar proposal was rejected in 2003,
because (as I understand it), even people who liked the syntax didn’t like the
fact that this was essentially optional, rather than a language change (cf.
Ada, C


Showing article 21 to 40 of 75 in channel 34075453
Channel Details:


I have created a msgs package containing a msg folder which contains the
custom messages in .msg format. When I try to import the .msg files in eclipse
from my module in python, eclipse gives an error that " No Module Named
msgs.msg". The exact code I use is - from msgs.msg import FloatStamped,
FloatArrayStamped, waypoint_navigation_status The folder structure is like
this surveying - package name src module.py (This is where I try to import the
msg files) msgs - package name msg - folder containing .msg files
FloatStamped.msg, FloatArrayStamped.msg, waypoint_navigation_status.msg Can
anybody please help?? Thanks


[ ](javascript:; "Ouch") 0


![2021-06-14-12.15.15](https://automaticaddison.com/wp-
content/uploads/2021/06/2021-06-14-12.15.15.jpg)


Hey guys, I wrote a custom message which looks like: geometry_msgs/Vector3[]
data so i got an array of Vector3()'s. I can use this message, echo it, etc...
So I am assuming that everything worked fine here. Now I am using an Arduino
Mega to subscribe this message. Which seems to work to. But I got the
following problem: I am publishing a message which contains out of 14
Vector3()'s and I am getting this error: [ERROR] [WallTime: 1430219046.856917]
Message from ROS network dropped: message larger than buffer. If I publish a
message which contains out of 4 Vector3()'s everything works fine. Is this
message really too big? Shoudnt it be something like 14 (entries in the array)
* 8 (Float64) * 3 (three points for each vector) = 336 Bytes? Is this really
too much for the Arduino?... I found out that I have to change the buffer as
descriped here http://wiki.ros.org/rosserial/Overview/Limitations. typedef
NodeHandle_  NodeHandle; I dont get the error anymore, but if I echo the topic
/Test (see in the code below) I dont see any value (at least for 14 entries in
the message. For 4 Values it works perfectly fine!). The Publisher for /Test
is made, so that I can see if the message gets transferred correctly. So
though I set the buffer up to 1024 Bytes [INFO] [WallTime: 1430223859.870142]
Note: subscribe buffer size is 1024 bytes the message is not transferred
correctly. Any ideas how to solve this problem? Thanks alot in advance! P.S.:
My general goal is to send speed information for two stepper motors and a
information about the time to the arduino. So each vector looks smth like: (v1
, v2 , t). And i got - at the moment - 14 of them. There might be more in the
future! In case that there is a more handy solution for this, feel free to
suggest. [EDIT] Actually I tried many Vector3()'s can be in the array, so that
the message will be transferred correctly. As chance would have it I only can
transfer 4 Vector3()'s in the array... That would only be 4 * 8 * 3 = 96 Bytes
right? :0 // einbinden der Bibliotheken #include  #include  #include  #include
#include  #include  ros::NodeHandle nh; std_msgs::Float32 test; ros::Publisher
testpub("Test", &test); // Interface, PIN1, PIN2 AccelStepper stepper_rot(1,
9, 8); AccelStepper stepper_lin(1, 3, 2); void stelldaten_transformation(
const vector_3_array::Vector3DArray& vectordaten_tabelle) { test.data =
vectordaten_tabelle.data[3].x; testpub.publish( &test); test.data =
vectordaten_tabelle.data[3].y; testpub.publish( &test); test.data =
vectordaten_tabelle.data[3].z; testpub.publish( &test); } void subscribetest(
const std_msgs::Bool& boolee) { test.data = 10.1; testpub.publish( &test); }
//Initialisieren der ROS Messages ros::Subscriber<:vector3darray>
vectordaten("Stelldaten", &stelldaten_transformation); ros::Subscriber<:bool>
booleantest("Boolean", &subscribetest); void setup() {
//stepper.setSpeed(4000); nh.initNode(); nh.subscribe(vectordaten);
nh.subscribe(booleantest); nh.advertise(testpub); } void loop() {
nh.spinOnce(); //stepper.runSpeed(); }


Start ROS.


If the ZED node is running and a camera is connected or you have loaded an SVO
file, you will receive the following stream of messages confirming that you
are correctly subscribing to the ZED positional tracking topics:


  * ` ~/path_map ` : The history of the camera pose in Map frame
  * ` ~/path_odom ` : The history of the odometry of the camera in Map frame


###  [ Wondershare PDFelement v7.x.x Patch v3.4 By Deltafox
](////topics4280.rssing.com/chan-62228694/article43158.html#c62228694a43158i1887057775)


I want to send the data from my robot to ROS over UART, I tried using
rosserial but was uncessful, then I tried using the code mentioned in the
below link but still I face some problems. I am using the code as mentioned in
the link: (answers.ros.org/question/10114/how-can-ros-communicate-with-my-
microcontroller/) The controller I am using is a 32-bit ARM Controller which
sends data over UART to PC (ROS running on Linux) over ttyUSB0 for every
100ms, but I can not see any received data from micro controller on PC, the
entire "ucResponse" buffer is only with zero's. I have checked that the data
from micro-controller is coming properly out. Can any one has any idea what is
going wrong..? Thanks in advance


The tutorial node subscribes to generic ` pose ` and ` odom ` topics, so a
remapping is required to connect to the correct topics published by the ZED
node:


        void poseCallback(const geometry_msgs::msg::PoseStamped::SharedPtr msg) {
            // Camera position in map frame
            double tx = msg->pose.position.x;
            double ty = msg->pose.position.y;
            double tz = msg->pose.position.z;

            // Orientation quaternion
            tf2::Quaternion q(
                        msg->pose.orientation.x,
                        msg->pose.orientation.y,
                        msg->pose.orientation.z,
                        msg->pose.orientation.w);

            // 3x3 Rotation matrix from quaternion
            tf2::Matrix3x3 m(q);

            // Roll Pitch and Yaw from rotation matrix
            double roll, pitch, yaw;
            m.getRPY(roll, pitch, yaw);

            // Output the measure
            RCLCPP_INFO(get_logger(), "Received pose in '%s' frame : X: %.2f Y: %.2f Z: %.2f - R: %.2f P: %.2f Y: %.2f - Timestamp: %u.%u sec ",
                     msg->header.frame_id.c_str(),
                     tx, ty, tz,
                     roll * RAD2DEG, pitch * RAD2DEG, yaw * RAD2DEG,
                        msg->header.stamp.sec,msg->header.stamp.nanosec);
        }

        void odomCallback(const nav_msgs::msg::Odometry::SharedPtr msg) {
            // Camera position in map frame
            double tx = msg->pose.pose.position.x;
            double ty = msg->pose.pose.position.y;
            double tz = msg->pose.pose.position.z;

            // Orientation quaternion
            tf2::Quaternion q(
                        msg->pose.pose.orientation.x,
                        msg->pose.pose.orientation.y,


Hellow all ! I'm trying to create a custom message using Geomety messages and
std msgs. But I can't seem to link it correctly. I've been following this
[tutorial](http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv#Common_step_for_msg_and_srv)
but so far I'm having this error : CMake Error at
/home/malcolm/ros_ws/hydro_ws/catkin_ws/build/Tobot/open_tld_3d/cmake/open_tld_3d-genmsg.cmake:3
(message): Could not find messages which
'/home/malcolm/ros_ws/hydro_ws/catkin_ws/src/Tobot/open_tld_3d/msg/square.msg'
depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [point] in package [open_tld_3d] with paths
[['/home/malcolm/ros_ws/hydro_ws/catkin_ws/src/Tobot/open_tld_3d/msg']] Indeed
you can find **point** in geometry_msgs and in my CMakeList.txt I added that:
generate_messages( DEPENDENCIES geometry_msgs std_msgs ) So for my
understanding, it should be able to find **Point**... This is my square.msg in
case : point x point y float64 width float64 height Nothing really complexe
and I'm pretty sure I'm missing something trivial but still... Thanks a lot !


###  [ Pumas 2022/2023 Font (TTF & OTF)
](////fonts1404.rssing.com/chan-57741102/article185.html#c57741102a185i1833605640)


In the constructor, we initialize the parent class ` Node ` with the name of
our node new ` zed_odom_pose_tutorial ` :


[ ![Have you seen Michael Wines? Burien man has been missing since
Saturday,...](//b-townblog.com/wp-
content/uploads/2024/04/michael-3shoe.jpg?_t=1712879471)
](////normandy480.rssing.com/chan-74604448/article56.html#c74604448a56i1857302427)


                return;
            }

            RCLCPP_INFO(this->get_logger(), "RESULT RECEIVED");
        }


[ w.ronaldo.cd  ](https://get-help.theconstruct.ai/u/w.ronaldo.cd) March 14,
2023, 3:25pm  3


###  Camera pose  #


[ ](javascript:; "Like") 0


![Saline County Jail Booking Activity – Thursday, December
10th](//thepost.s3.amazonaws.com/wp-content/uploads/2015/12/Lehoczky-Todd-
Edward-William1-300x203.jpg)


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


[ _≪_ Previous: teleoperation using custom key
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a36 "Previous
Article")


Do you notice the function definition difference here?


[ ](javascript:; "Ouch") 0


>
>     /home/user/ros2_ws/src/Wall
> Follower/wall_follower/src/wall_follower_part3.cpp: In member function 'void
> WallFollower::send_goal()':
>     /home/user/ros2_ws/src/Wall
> Follower/wall_follower/src/wall_follower_part3.cpp:119:66: error: no match
> for 'operator=' (operand types are
> 'rclcpp_action::Client<custom_interfaces::action::OdomRecord>::GoalResponseCallback'
> {aka
> 'std::function<void(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<custom_interfaces::action::OdomRecord>
> > >)>'} and 'std::_Bind_helper<false, void (WallFollower::*)(const
> std::shared_ptr<rclcpp_action::ClientGoalHandle<custom_interfaces::action::OdomRecord>
> >&), WallFollower*, const std::_Placeholder<1>&>::type' {aka
> 'std::_Bind<void (WallFollower::*(WallFollower*,
> std::_Placeholder<1>))(const
> std::shared_ptr<rclcpp_action::ClientGoalHandle<custom_interfaces::action::OdomRecord>
> >&)>'})
>       119 |         std::bind(&WallFollower::goal_response_callback, this,
> _1);
>           |
>


  * Title: ROS Answers: Open Source Q&A Forum - RSS feed
  * Channel Number: 34075453
  * Language: English
  * Registered On: October 26, 2014, 12:46 pm
  * Number of Articles: 75
  * Latest Snapshot: May 17, 2019, 10:37 am
  * RSS URL: [ http://answers.ros.org/feeds/rss/?tags=custom ](javascript:;)
  * Publisher: [ http://answers.ros.org/questions/ ](javascript:;)
  * Description: Open source question and answer forum written in Python and Django
  * Catalog: [ //question1970.rssing.com/catalog.php?indx=34075453 ](//question1970.rssing.com/catalog.php?indx=34075453)


  * [ LinkedIn  ](https://www.linkedin.com/in/addisonsearscollins/)
  * [ YouTube  ](https://www.youtube.com/channel/UCyR7hy8XDVnqzBhdpRirOtg)


#  [ Time Synchronizer (message_filters) with Custom Message type
](//question1970.rssing.com/chan-34075453/article31-live.html)


HI, i want to display something published in a custom Message on my android
device I get the error: E/scriberHandshakeHandler﹕ Subscriber handshake
failed: Message types don't match. i had some troubles setting up my textview
rosTextView_speed = (RosTextView_speed  ) findViewById(R.id.TextView01);
rosTextView_speed.setTopicName("veh_vehicle_model_dynamics"); //public void
setMessageType(String messageType) { // this.messageType = messageType; //}
rosTextView_speed.setMessageType(vehicle_model_dynamics._TYPE); // T = Return
Type //public void setMessageToStringCallable(MessageCallable  callable) { //
this.callable = callable; //} rosTextView_speed.setMessageToStringCallable(new
MessageCallable  () { //Überschreiben der Methode Call in MessageCallable //
RÜCKGABETYP call (MESSAGETYP) //public interface MessageCallable  { // T
call(S message); //} @Override public String call(vehicle_model_dynamics
message) { //velocity = message.getData(); Log.v("DEBUG:", "Speed Message
Callable"); return String.valueOf(message.getVelocity()); } }); in rqt i am
publishing topic: veh_vehicle_model_dynamics type:
ros_messages/vehicle_model_dynamics the velocity value 111 (float64) i also
imported my custom messages vehicle_model_dynamics.class in
custom_msgs-0.0.0.jar // IntelliJ API Decompiler stub source generated from a
class file // Implementation of methods is not available package custom_msgs;
public interface vehicle_model_dynamics extends
org.ros.internal.message.Message { java.lang.String _TYPE =
"custom_msgs/vehicle_model_dynamics"; java.lang.String _DEFINITION =
"####################################################\n #\n# Vehicle Model
Dynamic Information\n#\n# ...\n#\n # Description:
n#\n####################################################\n\n # ROS
Header\nHeader header \n\n # Data \n qualified_timed_float64 velocity # [m/s]
vehicle velocity \n\n qualified_timed_float64 acceleration_x # [m/s^2] vehicle
acceleration X \n\n qualified_timed_float64 acceleration_y # [m/s^2] ...
std_msgs.Header getHeader(); void setHeader(std_msgs.Header header);
custom_msgs.qualified_timed_float64 getVelocity(); void
setVelocity(custom_msgs.qualified_timed_float64 qualified_timed_float64);
custom_msgs.qualified_timed_float64 getAccelerationX(); void
setAccelerationX(custom_msgs.qualified_timed_float64 qualified_timed_float64);
... } any guesses what is wrong? Thanks \---------- rosnode info /play_rosbag:
Node [/play_rosbag] Publications: * /veh_vehicle_model_dynamics
[ros_messages/vehicle_model_dynamics] * /function_drivinggoal_desired
[ros_messages/function_drivinggoal] contacting node http://192.168.0.95:37820/
... Pid: 4151 Connections: * topic: /rosout * to: /rosout * direction:
outbound * transport: TCPROS ... Connection to
/android_gingerbread/ros_text_view_speed_limited missing Connection to


##  Connect With Me on LinkedIn!


comment-13885)

@CS There was a proposal for this for C++1y, but didn’t make it into the
draft. I believe the reasoning was that in the presence of `std::shared_ptr`
and `std::unique_ptr`, raw points should always be expressed as observing.
Unfortunately, your example of legacy code is exactly the reason why this was
a bad decision. I would love to see the “worlds dumbest smart pointer” get
revisited in the general library TS coming after C++14…

[ Click to access n3514.pdf ](http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2013/n3514.pdf)

  10. ![](https://0.gravatar.com/avatar/357b3f47e228003bf63f9fd4625d0f1864ac92002746392c438dce68058ea0ba?s=48&d=identicon&r=G) **CS** says:

[ 2013-12-11 at 6:11 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


A error would be a true error only if the error is produced during actual
compilation - ` colcon build ... ` in your case since you are working with
ROS2.
Do not be carried away by the IDE false-positives.


  * Position with RVIZ
  * Position info subscribing in C++


![Pumas 2022/2023 Font \(TTF &
OTF\)](//footballfonts.com/u/img/pumas-22-23-otf-font-installation.jpg)


  * Getting Started
  * [ Get Started With ZED  ](https://www.stereolabs.com/docs/get-started-with-zed/)
  * [ Get Started With ZED X  ](https://www.stereolabs.com/docs/get-started-with-zed-x/) [ Setup for ZED Box Orin NX ](https://www.stereolabs.com/docs/get-started-with-zed-x/zed-box-orin-nx-setup/) [ Setup for AGX Orin / Xavier ](https://www.stereolabs.com/docs/get-started-with-zed-x/jetson-agx-devkit-setup/) [ Setup for Xavier NX DevKits ](https://www.stereolabs.com/docs/get-started-with-zed-x/jetson-xavier-nx-devkit-setup/) [ Setup for Orin Nano / NX DevKits ](https://www.stereolabs.com/docs/get-started-with-zed-x/jetson-orin-devkit-setup/) [ Developing with ZED X on a PC ](https://www.stereolabs.com/docs/get-started-with-zed-x/zed-x-dev-on-pc/) [ Troubleshooting ](https://www.stereolabs.com/docs/get-started-with-zed-x/troubleshooting/) [ Advanced Topics ](https://www.stereolabs.com/docs/get-started-with-zed-x/advanced-topics/)
  * [ Get Started With ZED X One  ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/) [ Setting up the ZED X One Monocular ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/zed-x-one-mono/) [ Setting up the ZED X One Stereo ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/zed-x-one-stereo/) [ Developing with ZED X One Stereo on a PC ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/zed-x-dev-on-pc/) [ Troubleshooting ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/troubleshooting/) [ Advanced Topics ](https://www.stereolabs.com/docs/get-started-with-zed-x-one/advanced-topics/)
  * [ Get Started With ZED Box  ](https://www.stereolabs.com/docs/get-started-with-zed-box/)
  * [ Get Started With ZED Box Orin  ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/) [ Installation ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/installation/) [ Reset ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/reset-update/) [ Using GMSL ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/gmsl/) [ Using GNSS ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/gnss/) [ Troubleshooting ](https://www.stereolabs.com/docs/get-started-with-zed-box-orin-nx/troubleshooting/)
  * [ Installation  ](https://www.stereolabs.com/docs/installation/) [ Install on Windows ](https://www.stereolabs.com/docs/installation/windows/) [ Install on Linux ](https://www.stereolabs.com/docs/installation/linux/) [ Install on NVIDIA® Jetson ](https://www.stereolabs.com/docs/installation/jetson/) [ Docker ](https://www.stereolabs.com/docs/installation/docker/) [ Recommended Specifications ](https://www.stereolabs.com/docs/installation/specifications/)
  * [ C++ Development  ](https://www.stereolabs.com/docs/app-development/cpp/) [ Building on Windows ](https://www.stereolabs.com/docs/app-development/cpp/windows/) [ Building on Linux and NVIDIA® Jetson ](https://www.stereolabs.com/docs/app-development/cpp/linux/)
  * [ Python Development  ](https://www.stereolabs.com/docs/app-development/python/install/) [ Run a Python Application ](https://www.stereolabs.com/docs/app-development/python/run/) [ Python Virtual Environment ](https://www.stereolabs.com/docs/app-development/python/virtual_env/)
  * [ C# Development  ](https://www.stereolabs.com/docs/app-development/csharp/use/)
  * [ C Development  ](https://www.stereolabs.com/docs/app-development/c/install/) [ Run a C Application ](https://www.stereolabs.com/docs/app-development/c/run/)
  * SDK Overview
  * [ Camera  ](https://www.stereolabs.com/docs/video/) [ Camera Controls ](https://www.stereolabs.com/docs/video/camera-controls/) [ Camera Calibration ](https://www.stereolabs.com/docs/video/camera-calibration/) [ Video Recording ](https://www.stereolabs.com/docs/video/recording/) [ Local Streaming ](https://www.stereolabs.com/docs/video/streaming/) [ Multi-Camera ](https://www.stereolabs.com/docs/video/multi-camera/) [ Using the API ](https://www.stereolabs.com/docs/video/using-video/)
  * [ Sensors  ](https://www.stereolabs.com/docs/sensors/) [ IMU ](https://www.stereolabs.com/docs/sensors/imu/) [ Magnetometer ](https://www.stereolabs.com/docs/sensors/magnetometer/) [ Barometer ](https://www.stereolabs.com/docs/sensors/barometer/) [ Temperature Sensors ](https://www.stereolabs.com/docs/sensors/temperature/) [ Time Synchronization ](https://www.stereolabs.com/docs/sensors/time-synchronization/) [ Using the API ](https://www.stereolabs.com/docs/sensors/using-sensors/)
  * [ Depth Sensing  ](https://www.stereolabs.com/docs/depth-sensing/) [ Depth Settings ](https://www.stereolabs.com/docs/depth-sensing/depth-settings/) [ Confidence Filtering ](https://www.stereolabs.com/docs/depth-sensing/confidence-filtering/) [ Using the API ](https://www.stereolabs.com/docs/depth-sensing/using-depth/)
  * [ Positional Tracking  ](https://www.stereolabs.com/docs/positional-tracking/) [ Relocalization ](https://www.stereolabs.com/docs/positional-tracking/area-memory/) [ Coordinate Frames ](https://www.stereolabs.com/docs/positional-tracking/coordinate-frames/) [ Use Cases ](https://www.stereolabs.com/docs/positional-tracking/use-cases/) [ Using the API ](https://www.stereolabs.com/docs/positional-tracking/using-tracking/)
  * [ Global Localization  ](https://www.stereolabs.com/docs/global-localization/) [ Setting up GNSS / RTK ](https://www.stereolabs.com/docs/global-localization/using-gnss-linux/)
  * [ Spatial Mapping  ](https://www.stereolabs.com/docs/spatial-mapping/) [ Using the API ](https://www.stereolabs.com/docs/spatial-mapping/using-mapping/) [ Plane Detection ](https://www.stereolabs.com/docs/spatial-mapping/plane-detection/)
  * [ Object Detection  ](https://www.stereolabs.com/docs/object-detection/) [ Using the API ](https://www.stereolabs.com/docs/object-detection/using-object-detection/) [ Custom Detector ](https://www.stereolabs.com/docs/object-detection/custom-od/)
  * [ Body Tracking  ](https://www.stereolabs.com/docs/body-tracking/) [ Using the API ](https://www.stereolabs.com/docs/body-tracking/using-body-tracking/)
  * [ Fusion  ](https://www.stereolabs.com/docs/fusion/overview/) [ ZED360 ](https://www.stereolabs.com/docs/fusion/zed360/)
  * Code Samples
  * [ Tutorials  ](https://www.stereolabs.com/docs/tutorials/) [ Tutorial - Hello ZED ](https://www.stereolabs.com/docs/tutorials/hello-zed/) [ Tutorial - Image Capture ](https://www.stereolabs.com/docs/tutorials/image-capture/) [ Tutorial - Depth Perception ](https://www.stereolabs.com/docs/tutorials/depth-sensing/) [ Tutorial - Camera Tracking ](https://www.stereolabs.com/docs/tutorials/positional-tracking/) [ Tutorial - Spatial Mapping ](https://www.stereolabs.com/docs/tutorials/spatial-mapping/) [ Tutorial - Object Detection ](https://www.stereolabs.com/docs/tutorials/3d-object-detection/) [ Tutorial - Using Sensors ](https://www.stereolabs.com/docs/tutorials/using-sensors/) [ Tutorial - Body Tracking ](https://www.stereolabs.com/docs/tutorials/body-tracking/)
  * [ Samples  ](https://www.stereolabs.com/docs/samples/)
  * Integrations
  * [ Overview  ](https://www.stereolabs.com/docs/integrations/)
  * [ ROS  ](https://www.stereolabs.com/docs/ros/) [ ZED Node ](https://www.stereolabs.com/docs/ros/zed-node/) [ ZED Nodelets ](https://www.stereolabs.com/docs/ros/zed-nodelets/) [ Data Display with Rviz ](https://www.stereolabs.com/docs/ros/rviz/) [ Video Capture ](https://www.stereolabs.com/docs/ros/video/) [ Depth Perception ](https://www.stereolabs.com/docs/ros/depth-sensing/) [ Positional Tracking ](https://www.stereolabs.com/docs/ros/positional-tracking/) [ Plane Detection ](https://www.stereolabs.com/docs/ros/plane_detection/) [ Object Detection ](https://www.stereolabs.com/docs/ros/object-detection/) [ Getting Sensor Data ](https://www.stereolabs.com/docs/ros/sensor-data/)
  * [ ROS 2  ](https://www.stereolabs.com/docs/ros2/) [ ZED Node ](https://www.stereolabs.com/docs/ros2/zed-node/) [ Data Display with Rviz2 ](https://www.stereolabs.com/docs/ros2/rviz2/) [ Video Capture ](https://www.stereolabs.com/docs/ros2/video/) [ Depth Perception ](https://www.stereolabs.com/docs/ros2/depth-sensing/) [ Positional Tracking ](https://www.stereolabs.com/docs/ros2/positional-tracking/) [ Geo Tracking ](https://www.stereolabs.com/docs/ros2/geo-tracking/) [ Plane Detection ](https://www.stereolabs.com/docs/ros2/plane-detection/) [ Object Detection ](https://www.stereolabs.com/docs/ros2/object-detection/) [ Body Tracking ](https://www.stereolabs.com/docs/ros2/body-tracking/) [ Region of Interest ](https://www.stereolabs.com/docs/ros2/region-of-interest/) [ Custom messages ](https://www.stereolabs.com/docs/ros2/custom-msgs/) [ Composition ](https://www.stereolabs.com/docs/ros2/ros2-composition/) [ Robot Integration ](https://www.stereolabs.com/docs/ros2/ros2-robot-integration/)
  * [ Isaac Sim  ](https://www.stereolabs.com/docs/isaac-sim/) [ Getting started with Isaac Sim ](https://www.stereolabs.com/docs/isaac-sim/isaac_sim/) [ Setting up ZED in Isaac Sim ](https://www.stereolabs.com/docs/isaac-sim/setting_up_zed_isaac_sim/) [ Using ZED with ROS 2 and Isaac Sim ](https://www.stereolabs.com/docs/isaac-sim/ros2_integration/)
  * [ OpenCV  ](https://www.stereolabs.com/docs/opencv/) [ Python Interface ](https://www.stereolabs.com/docs/opencv/python/) [ OpenCV Calibration ](https://www.stereolabs.com/docs/opencv/calibration/)
  * [ PyTorch  ](https://www.stereolabs.com/docs/pytorch/)
  * [ YOLO  ](https://www.stereolabs.com/docs/yolo/) [ YOLO_python ](https://www.stereolabs.com/docs/yolo/python/)
  * [ Docker  ](https://www.stereolabs.com/docs/docker/) [ Install Guide on Linux ](https://www.stereolabs.com/docs/docker/install-guide-linux/) [ Install Guide on NVIDIA® Jetson ](https://www.stereolabs.com/docs/docker/install-guide-jetson/) [ Creating a Docker Image ](https://www.stereolabs.com/docs/docker/creating-your-image/) [ Orchestrate containers ](https://www.stereolabs.com/docs/docker/orchestration/) [ Using OpenCV ](https://www.stereolabs.com/docs/docker/using-opencv/) [ Create an OpenCV image ](https://www.stereolabs.com/docs/docker/configure-opencv-dockerfile/) [ Using ROS/2 ](https://www.stereolabs.com/docs/docker/using-ros/) [ Create a ROS image ](https://www.stereolabs.com/docs/docker/configure-ros-dockerfile/) [ Create a ROS 2 image ](https://www.stereolabs.com/docs/docker/configure-ros2-dockerfile/) [ Building Images for NVIDIA® Jetson ](https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/)
  * [ Unity  ](https://www.stereolabs.com/docs/unity/) [ Key Concepts & Scripts ](https://www.stereolabs.com/docs/unity/basic-concepts/) [ Building Applications ](https://www.stereolabs.com/docs/unity/building-applications-with-zed/) [ AR Video Passthrough ](https://www.stereolabs.com/docs/unity/video-passthrough/) [ Build Your First AR/MR App ](https://www.stereolabs.com/docs/unity/creating-mixed-reality-app/) [ Body Tracking ](https://www.stereolabs.com/docs/unity/body-tracking/) [ Spatial Mapping ](https://www.stereolabs.com/docs/unity/spatial-mapping-unity/) [ Mixed Reality Capture ](https://www.stereolabs.com/docs/unity/mixed-reality-capture/) [ Object Detection ](https://www.stereolabs.com/docs/unity/object-detection/) [ Lighting and Shadows ](https://www.stereolabs.com/docs/unity/lighting/) [ Motion Controllers in AR ](https://www.stereolabs.com/docs/unity/motion-controllers-passthrough/) [ Object Placement ](https://www.stereolabs.com/docs/unity/object-placement/) [ Using OpenCV in Unity ](https://www.stereolabs.com/docs/unity/using-opencv-with-unity/) [ Green Screen VR Capture ](https://www.stereolabs.com/docs/unity/green-screen-vr/) [ Sample scenes ](https://www.stereolabs.com/docs/unity/samples/)
  * [ Unreal Engine 5  ](https://www.stereolabs.com/docs/ue5/) [ Configuring your Project ](https://www.stereolabs.com/docs/ue5/configuring-your-project/) [ Body Tracking ](https://www.stereolabs.com/docs/ue5/body-tracking/) [ Camera Tracking ](https://www.stereolabs.com/docs/ue5/camera-tracking/) [ AR/MR ](https://www.stereolabs.com/docs/ue5/ar_mr_app/) [ Spatial Mapping ](https://www.stereolabs.com/docs/ue5/spatial-mapping/) [ Object Detection ](https://www.stereolabs.com/docs/ue5/object-detection/) [ Background Subtraction ](https://www.stereolabs.com/docs/ue5/background-subtraction/)
  * [ Live Link  ](https://www.stereolabs.com/docs/livelink/)
    * [ Live Link for UE5  arrow  ](https://www.stereolabs.com/docs/livelink/livelink-ue5/) [ Animating New Avatars ](https://www.stereolabs.com/docs/livelink/animate-new-avatar/) [ Building ZED Live Link ](https://www.stereolabs.com/docs/livelink/building-the-plugin/)
[ Live Link for Unity ](https://www.stereolabs.com/docs/livelink/livelink-
unity/)


The ` Topic ` to be subscribed to is ` ~/ ` pose`.


dev | SevenNet ](http://sevennet.org/2014/12/27/fixed-c-passing-references-to-stdshared_ptr-or-boostshared_ptr-it-answer-dev/)

  2. ![](https://2.gravatar.com/avatar/eafff6dba4d2c5594a8d042209fc258204dd9ecb78d264a674c9f151e5a2458b?s=48&d=identicon&r=G) **tohava** says:

[ 2014-12-15 at 11:59 am
](https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-
parameters/


[ ](javascript:; "Like") 0


F5&, F6&, F7&, F8&) [with F0 = message_filters::Subscriber<:featurebarray_>>>,
F1 = message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, F4 =
message_filters::NullFilter<:nulltype>, F5 =
message_filters::NullFilter<:nulltype>, F6 =
message_filters::NullFilter<:nulltype>, F7 =
message_filters::NullFilter<:nulltype>, F8 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:282:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&, F3&, F4&,
F5&, F6&, F7&) [with F0 = message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, F4 =
message_filters::NullFilter<:nulltype>, F5 =
message_filters::NullFilter<:nulltype>, F6 =
message_filters::NullFilter<:nulltype>, F7 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:275:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&, F2&, F3&, F4&,
F5&, F6&) [with F0 = message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, F2 =
message_filters::NullFilter<:nulltype>, F3 =
message_filters::NullFilter<:nulltype>, F4 =
message_filters::NullFilter<:nulltype>, F5 =
message_filters::NullFilter<:nulltype>, F6 =
message_filters::NullFilter<:nulltype>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,


` std::bind(&MinimalDepthSubscriber::<callback_name>, this, _1) ` .


[ ](//question1970.rssing.com/chan-34075453/all_p1.html "older") Page 1  Page
2  Page 3  Page 4  [ ](//question1970.rssing.com/chan-34075453/all_p3.html
"newer")


cd ~/catkin_ws/src/jetson_nano_bot/localization_data_pub/src


In this tutorial, you will learn in detail how to configure your own RVIZ
session to see only the position data information that you require.


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


[ 0  ](javascript:; "Show Rating")


###  Running the tutorial  #


comment-11121)

What do you think of using something like ptr [1] which is usable like a T*
but is implicitly convertible from any smart pointer and clearly marks non-
owning semantics? I’ve found that in code that uses smart pointers, functions
that take a bare pointer are annoying because you have to call get(), breaking
the abstraction. It also has a nice side benefit of less visual ambiguity
between const ptr and ptr.

On the related issue of pointer returns, do you know why covariant return
support wasn’t added for smart pointers? It seems like a clone() method would
have to choose between better type-safety but using a raw owning pointer or
returning a smart pointer and requiring casts.

[1] [ https://gist.github.com/RedBeard0531/5736292
](https://gist.github.com/RedBeard0531/5736292) (written for C++98 + boost)

  26. ![](https://0.gravatar.com/avatar/928f5830f12d8977791539452bfc25c92912322476f0725253697ee1c45ce036?s=48&d=identicon&r=G) **[ Herb Sutter ](http://www.herbsutter.com) ** says:

[ 2013-06-07 at 5:03 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


The source code of the subscriber node ` zed_tutorial_pos_tracking.cpp ` :


RSSing.com


[ ](https://github.com/stereolabs "GitHub") [
](https://www.linkedin.com/company/stereolabs "LinkedIn") [
](https://twitter.com/stereolabs3d "X \(Twitter\)") [
](https://www.youtube.com/Stereolabs3d "YouTube")


[ _≫_ Next: custom rqt gui
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a35 "Next
Article")


#  [ rosserial_arduino Create custom messages from custom messages
](//question1970.rssing.com/chan-34075453/article33-live.html)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle36-live.html
"Article Support")


91 Solution: Smart Pointer Parameters

[ Herb Sutter ](https://herbsutter.com/author/herbsutter/ "Posts by Herb
Sutter") [ C++ ](https://herbsutter.com/category/c/) 2013-06-05  2013-12-03  9
Minutes

> **NOTE:** Last year, I posted three new GotWs numbered


[ Search ](javascript:;)


[ _≫_ Next: Declare array of custom type
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a24 "Next
Article")


[ ](javascript:; "Ouch") 0


[ ](javascript:; "Like") 0


#  [ Error in Importing Custom Message Types in a Python File in Eclipse
](//question1970.rssing.com/chan-34075453/article29-live.html)


GotW


Open a new C++ file called **ekf_odom_pub.cpp.**


![Wondershare PDFelement v7.x.x Patch v3.4 By
Deltafox](//i.imgur.com/u8v9Ga1.jpg)


Save the file, and close it.


##  Top-Rated Images


comment-33772)

It is also useful to pass const shared_ptr & if the function creates a weak
pointer from the shared pointer.

  3. ![](https://2.gravatar.com/avatar/8928011df9bfb0930a3161ba22601a764e09aa7904bb7b33674635a81aa426e0?s=48&d=identicon&r=G) **mikef** says:

[ 2014-09-01 at 8:35 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


  * [ Login  ](//www.rssing.com/account.php?a=lgi&t=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Fall_p2.html)
    * [ Account ](//www.rssing.com/account.php)
    * [ Sign Up ](//www.rssing.com/account.php?a=reg&t=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Fall_p2.html)


[ w.ronaldo.cd  ](https://get-help.theconstruct.ai/u/w.ronaldo.cd) March 15,
2023, 9:00pm  5


        // Orientation quaternion
        tf2::Quaternion q(
            msg->pose.orientation.x,
            msg->pose.orientation.y,
            msg->pose.orientation.z,
            msg->pose.orientation.w);

        // 3x3 Rotation matrix from quaternion
        tf2::Matrix3x3 m(q);

        // Roll Pitch and Yaw from rotation matrix
        double roll, pitch, yaw;
        m.getRPY(roll, pitch, yaw);


            // Output the measure
            RCLCPP_INFO(get_logger(), "Received pose in '%s' frame : X: %.2f Y: %.2f Z: %.2f - R: %.2f P: %.2f Y: %.2f - Timestamp: %u.%u sec ",
                     msg->header.frame_id.c_str(),
                     tx, ty, tz,
                     roll * RAD2DEG, pitch * RAD2DEG, yaw * RAD2DEG,
                        msg->header.stamp.sec,msg->header.stamp.nanosec);


#  [ custom message generation causes problems when compiling my code
](//question1970.rssing.com/chan-34075453/article30-live.html)


rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200


[ X ](javascript:;) Are you the publisher? [ Claim
](//www.rssing.com/account.php?a=mmc&r=34075453) or [ contact us
](//www.rssing.com/contact.php?a=ssm&r=o5&u=//question1970.rssing.com/chan-34075453/all_p2.html)
about this channel.


Sorry, I could not identify this error earlier. My bad. Thanks for your
patience. Much appreciated!


This is my first attempt at ROS, and I have spent a lot of time researching
and reading, but there is one "small" piece that escapes me... Here is my
setup PC (Ubuntu 14.04) Full ROS install PC/104 (Ubuntu 14.04) minimal ROS
install
..................................................................................................|
..............................................................................................PC/104
Digital I/O card (PCM-3724) I was able to run roscore on the PC/104, and start
turtle_sim_node and turtle_teleop_key on the PC... so far so good. Now I want
to interface to the PCM-3724. What would be the best way to write the write()
and read() functions? Do I write a linux device driver and then when I start
my new node pass in the /dev/xxx parameter? Any example code (or links to) of
writing and reading would be greatly appreciated!!!


[ _≪_ Previous: Documentation on writing hardware drivers
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a39 "Previous
Article")


[ _≪_ Previous: Using custom messages in ROSAndroid
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a25 "Previous
Article")


[ ](javascript:; "Like") 0


Extracting the orientation is less straightforward as it is published as a
quaternion vector. To convert the quaternion to a more readable form, we must
first convert it to a 3x3 rotation matrix from which we can finally extract
the three values for Roll, Pitch and Yaw in radians.


  (d) Passing unique_ptr by reference is for in/out unique_ptr parameters.

    void f( unique_ptr<widget>& );  (d)

This should only be used to accept an in/out  unique_ptr  , when the function
is supposed to actually accept an existing  unique_ptr  and potentially modify
it to refer to a different object. It is a bad way to just accept a  widget  ,
because it is restricted to a particular lifetime strategy in the caller.

> **Guideline:** Use a non-const **unique_ptr & ** parameter only to modify
> the **unique_ptr** .

Passing a  const unique_ptr<widget>& is strange because it can accept only
either null or a  widget  whose lifetime happens to be managed in the calling
code via a  unique_ptr  , and the callee generally shouldn’t care about the
caller’s lifetime management choice. Passing  widget*  covers a strict
superset of these cases and can accept “null or a  widget  ” regardless of the
lifetime policy the caller happens to be using.

> **Guideline:** Don’t use a **const unique_ptr & ** as a parameter; use
> **widget*** instead.

I mention  widget*  because that doesn’t change the (nullable) semantics; if
you’re being tempted to pass  const shared_ptr<widget>& , what you really
meant was  widget*  which expresses the same information. If you additionally
know it can’t be null, though, of course use  widget& .


Go to the bottom of the file.


Let’s create an odometry publisher that is based on wheel encoder data (no [
IMU inputs ](https://automaticaddison.com/how-to-publish-imu-data-using-ros-
and-the-bno055-imu-sensor/) ). This node will subscribe to the following
topics (ROS message types are in parentheses):


[ _≫_ Next: Documentation on writing hardware drivers
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a39 "Next
Article")


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


April 11, 2024, 5:27 pm


comment-13302)

@jlehrer
You can use template alias for that.

        template <class T>
    using pointer = T*;

  14. ![](https://2.gravatar.com/avatar/22cef4c4339ca700ce58fd79c311243f87ddd220788be7e1aa498621626bbb75?s=48&d=identicon&r=G) **earwicker** says:

[ 2013-07-06 at 2:13 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ X ](javascript:;) 0


Finally, the ` main ` function is standard for a ROS 2 node that executes a
single component:


). The argument was that for

        f(out(x),y)

you technically still don’t know if y is mutable or not, because the evil
library writer could still be using normal references.

[ http://lists.boost.org/Archives/boost/2003/04/47180.php
](http://lists.boost.org/Archives/boost/2003/04/47180.php)

  31. ![](https://0.gravatar.com/avatar/fabb1dfebdd8c266b012412b0be80078c4303820961ca3e39e38aaf62a761cdf?s=48&d=identicon&r=G) **[ decourse ](http://gravatar.com/decourse) ** says:

[ 2013-06-05 at 11:34 pm
](https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-
parameters/


comment-10979)

@Herb, Well that’s unfortunate; I assumed std::optional would work like
boost’s (plus move semantics). I can see the point that reference types
represent a somewhat awkward subset of std::optional T.

Also, I assume your own comment got mangled when you said “std::optional isn’t
standrad” ;-)

  43. ![](https://0.gravatar.com/avatar/928f5830f12d8977791539452bfc25c92912322476f0725253697ee1c45ce036?s=48&d=identicon&r=G) **[ Herb Sutter ](http://www.herbsutter.com) ** says:

[ 2013-06-05 at 2:30 pm  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


The ` Pose ` plugin provides a visualization of the position and orientation
of the camera ( ` geometry_msgs/PoseStamped ` ) in the Map frame.


$ ros2 run zed_tutorial_pos_tracking zed_tutorial_pos_tracking


comment-14060)

If I saw (d) or (f) in a code review I would most likely send it back to the
author for a rewrite with this note:

If these are just out parameters, return them:

        unique_ptr<widget> f();  (d)
    shared_ptr<widget> f();  (f)

If you need to return more than the widget, repack the other return values as
out parameters.

If the widgets are in/out, you’re really passing one widget as an in parameter
and returning another, so separate them:

        unique_ptr<widget> f(widget const * src_widget);  (d)
    shared_ptr<widget> f(widget const * src_widget);  (f)

Using in/out parameters is already confusing enough; combining in and out
ownership policies into one parameter is inviting a disaster.

  9. ![](https://i0.wp.com/lh5.googleusercontent.com/-a2qeRK18n48/AAAAAAAAAAI/AAAAAAAAC_w/C9f5E5zSHrQ/photo.jpg?resize=48%2C48&ssl=1) **[ Bret Kuhns ](https://plus.google.com/+BretKuhns) ** says:

[ 2013-12-19 at 9:56 am  ](https://herbsutter.com/2013/06/05/gotw-91-solution-
smart-pointer-parameters/


[ ](javascript:; "Ouch") 0


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle28-live.html
"Article Support")


#  [ compile twice to see custom message
](//question1970.rssing.com/chan-34075453/article22-live.html)


Hi [ @bayodesegun ](/u/bayodesegun)
The error is quite large


I have not gone through your code yet, but from what I did, I am telling you.
That error what the IDE produces is a false-positive.


    // it's clearer in the calling code that ownership transfer is going on
    // (this older code has an owning * which we shouldn't do in new code)
    //
    widget* pw = ... ;

    bad_sink ( pw );             // compiles: remember not to use pw again!

    good_sink( pw );             // error: good
    good_sink( unique_ptr<widget>{pw} );  // need explicit conversion: good

    // Modern calling code that calls good_sink is safer, and cleaner too
    //
    unique_ptr<widget> pw = ... ;

    bad_sink ( pw.get() );       // compiles: icky! doesn't reset pw
    bad_sink ( pw.release() );   // compiles: must remember to use this way

    good_sink( pw );             // error: good!
    good_sink( move(pw) );       // compiles: crystal clear what's going on

> **Guideline:** Express a “sink” function using a by-value **unique_ptr**
> parameter.

Because the callee will now own the object, usually there should be no  const
on the parameter because the  const  should be irrelevant.


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion1970.rssing.com%2Fchan-34075453%2Farticle31-live.html
"Article Support")


catkin_make --only-pkg-with-deps localization_data_pub


Finally, we can print the information received to the screen after converting
the radian values to degrees with the timestamp of the message.


Title:


April 8, 2024, 1:08 pm


###  [ Good Will Hunting 1997 Dual Audio 720p BRRip [Hindi – English] ESubs
](////downloadhub26.rssing.com/chan-63389705/article159.html#c63389705a159i1981662480)


so far we are moving out P3AT (spawned in USARSim) from my ROS machine using
teleoperation. The difficulty we are observing is,
-using default teleoperation key is not comfortable to operate the robot.
**-we want to drive it using arrow key given on keyboard** (which is also used
by most of the computer games).
does ROS provide this facility. Or what next we should do.


  * Indoor Delivery Robots
  * Room Service Robots
  * Mapping of Underground Mines, Caves, and Hard-to-Reach Environments
  * Robot Vacuums
  * Order Fulfillment
  * Factories


[ ↂ
](////talos181.rssing.com/chan-58296078/article541.html#c58296078a541i381855922
"JasperLoader Emerges, Targets Italy with Gootkit Banking Trojan")


Then the code of the node is executed in the main thread using the `
rclcpp::spin(pos_track_node); ` command. The node will run until the user
presses Ctrl+C to stop it, shut it down, and exit.


[ w.ronaldo.cd  ](https://get-help.theconstruct.ai/u/w.ronaldo.cd) March 13,
2023, 6:09pm  1


March 13, 2015, 10:51 am


[ ![People's Blog • First Pictures of the Eclipse ! !
!](//thepeoplescube.com/red/download/file.php?id=57243&sid=3721c68912ad1a7b63f4cf1eafba9b41)
](////satire3490.rssing.com/chan-77006292/article253.html#c77006292a253i838655542)


  * [ Create a Launch File for a Simulated Robotic Arm – ROS 2 ](https://automaticaddison.com/create-a-launch-file-for-a-simulated-robotic-arm-ros-2/)
  * [ Calculating Wheel Odometry for a Differential Drive Robot ](https://automaticaddison.com/calculating-wheel-odometry-for-a-differential-drive-robot/)
  * [ Calculating Wheel Velocities for a Differential Drive Robot ](https://automaticaddison.com/calculating-wheel-velocities-for-a-differential-drive-robot/)
  * [ The Complete Guide to Parameters – ROS 2 C++ ](https://automaticaddison.com/the-complete-guide-to-parameters-ros-2-c/)
  * [ The Complete Guide to Parameters – ROS 2 Python ](https://automaticaddison.com/the-complete-guide-to-parameters-ros-2-python/)


[ error ](https://get-help.theconstruct.ai/tag/error)


[ system  ](https://get-help.theconstruct.ai/u/system) Closed  March 21, 2023,
10:26pm  9


The constructor mainly defines ` mPoseSub ` and ` mOdomSub ` , a `
std::SharedPtr ` to two objects that create two subscribers in the node. The
subscribers check for topics of type ` pose ` and ` odom ` and recall the
callback functions ` MinimalPoseOdomSubscriber::poseCallback ` and `
MinimalPoseOdomSubscriber::odomCallback ` every time they receive one of them.


message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/synchronizer.h:240:5: instantiated from
‘void message_filters::Synchronizer  ::connectInput(F0&, F1&) [with F0 =
message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, Policy =
message_filters::sync_policies::ExactTime<:featurebarray_>>,
nav_msgs::Odometry_<:allocator>>, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType,
message_filters::NullType, message_filters::NullType>]’
/opt/ros/hydro/include/message_filters/time_synchronizer.h:120:5: instantiated
from ‘message_filters::TimeSynchronizer  ::TimeSynchronizer(F0&, F1&,
uint32_t) [with F0 = message_filters::Subscriber<:featurebarray_>>>, F1 =
message_filters::Subscriber<:odometry_>>>, M0 =
coop_est::FeatureBArray_<:allocator>>, M1 = nav_msgs::Odometry_<:allocator>>,
M2 = message_filters::NullType, M3 = message_filters::NullType, M4 =
message_filters::NullType, M5 = message_filters::NullType, M6 =
message_filters::NullType, M7 = message_filters::NullType, M8 =
message_filters::NullType, uint32_t = unsigned int]’
/home/quadrotor/catkin_ws/src/coop_est/src/coop_node.cpp:327:107: instantiated
from here
/opt/ros/hydro/include/message_filters/sync_policies/exact_time.h:181:7:
error: ‘value’ is not a member of
‘ros::message_traits::TimeStamp<:featurebarray_>>, void>’ make[2]: ***
[coop_est/CMakeFiles/coop_node.dir/src/coop_node.cpp.o] Error 1 make[1]: ***
[coop_est/CMakeFiles/coop_node.dir/all] Error 2 make: *** [all] Error 2
Invoking "make" failed Thank you for your help.


  * You have already [ set up your NVIDIA Jetson Nano ](https://automaticaddison.com/how-to-set-up-the-nvidia-jetson-nano-developer-kit/) (4GB, B01) [ with ROS ](https://automaticaddison.com/how-to-install-ros-melodic-on-the-nvidia-jetson-nano/) . You can also use an Ubuntu-enabled Raspberry Pi that has ROS installed.
  * You have completed [ this tutorial in which you learn how to create an initial pose and goal publisher using ROS and RViz. ](https://automaticaddison.com/how-to-create-an-initial-pose-and-goal-publisher-in-ros/)
  * You have a node that [ publishes the tick counts (using Arduino) ](https://automaticaddison.com/how-to-control-a-robots-velocity-remotely-using-ros/) for the wheels of your robot.
  * We will continue from the launch file I worked on [ in this post ](https://automaticaddison.com/how-to-create-an-initial-pose-and-goal-publisher-in-ros/) .
  * You have a robot. I will continue with [ my two-wheeled differential drive robot ](https://automaticaddison.com/how-to-publish-imu-data-using-ros-and-the-bno055-imu-sensor/) .


57 thoughts on “  GotW


[ Automatic Addison ](https://automaticaddison.com/)


89-91 to continue the sequence. Here is the updated version of what was
> GotW


[ _≫_ Next: rosserial_arduino generate dependent packages before
make_libraries
](//question1970.rssing.com/chan-34075453/all_p2.html#c34075453a34 "Next
Article")


The ROS 2 environment is initialized using the ` rclcpp::init ` command. Then
we create a ` pos_track_node ` Component as a ` std::shared_ptr ` . to the `
MinimalPoseOdomSubscriber ` class that we defined above.


The ZED wrapper provides two different paths for the camera position and
orientation:


it


###  [ JasperLoader Emerges, Targets Italy with Gootkit Banking Trojan
](////talos181.rssing.com/chan-58296078/article541.html#c58296078a541i381855922)