_broadcastOdometry parameters problem
ysys98 opened this issue · comments
#76
Still this problem, I found that it should be the problem of parameter of _ broadcastodometry (self, odometry_publisher), so I passed odom_pub into parameter to Is wrong?
And I changed odometry_ publisher file changed from .CPP to .Py file
And then when I run
It shows the error log:
"odom_pub" is not defined
I don't really understand what you're trying to do here, but as specified in the comments of the method, _broadcastOdometry
is an internal method and shouldn't be used in a script. The method is defined in the RosWrapper
class, and the ROS wrapper for each robot (PepperRosWrapper etc) inherit from that class. You don't need to call the _broadcastOdometry
method manually, it's done automatically when you launch the wrapper.
Here's a quick example:
if __name__ == "__main__":
simulation_manager = SimulationManager()
wrap = PepperRosWrapper()
camera_id = PepperVirtual.ID_CAMERA_BOTTOM
pepper = simulation_manager.spawnPepper(client, spawn_ground_plane=True)
wrap.launchWrapper(pepper, "/naoqi_driver")
handle = pepper.subscribeCamera(camera_id)
try:
rospy.spin()
except KeyboardInterrupt:
pass
except rospy.ROSInterruptException:
pass
finally:
wrap.stopWrapper()
simulation_manager.stopSimulation(client)
The launchWrapper
is all you need, the odometry will be broadcasted
I'm going to move this issue into the discussions and widen the scope of the issue a bit, since I think the issue has more to do with the joint usage of ROS with qiBullet. If a specific issue with the simulation arises, we'll create a more specific issue