Robotics StackExchange | Archived questions

Static topic name ignores the group_ns

Hi,

I have declared the topics in my class like this:

_m_state_publisher = motor_nh.advertise<maxon_epos_msgs::MotorState>(_motor_name + "/get_state", 100);
_m_state_subscriber = motor_nh.subscribe("/set_state", 100, &EposMotor::writeCallback, this) 

And I have launched like this:

 <group ns="right">
  <node pkg="maxon_epos_driver" type="maxon_bringup" name="maxon_bringup" output="screen">
    <rosparam file="$(find maxon_epos_ros)/config/example.yaml" command="load" />
  </node>

And during the launch, motor_name and group_ns worked:

/right/maxon_tr/motor_name: ['bottom_left_mot...
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /use_sim_time: False

NODES
  /right/

However I am getting this topic names:

/get_state
/set_state

Why is this? maxontr (maxoneposdriver/maxonbringup)

Asked by EdwardNur on 2019-06-19 07:56:35 UTC

Comments

Answers

Why is this?

because you've made /get_state and /set_state global names, which are "considered fully resolved" (ie: cannot be remapped any more).

Refer to wiki/Names - Resolving.

Asked by gvdhoorn on 2019-06-19 08:58:40 UTC

Comments