Problem subscribing to ax12_controller_core topic
Hi, I am new to ros and I have a dynamixel ax12 driver publishing position information and I want to access that info and put into a variable that I can use for a transform. I have done the publisher and listener tutorial successfully, but I am having trouble getting it to work with the dynamixel. Specifically I am unsure of how to change the paramaters in void since the motor doesnt seem to use std_msgs. Any suggestions? Below are the topic data and what I have for my listener.cpp program so far.
rostopic list= /motor_states/ttyUSB0
/motor_states/ttyUSB0 [ax12_driver_core/MotorStateList] 1 publisher
rosmsg show ax12_driver_core/MotorStateList
ax12_driver_core/MotorState[] motor_states
float64 timestamp
int32 id
int32 goal
int32 position
int32 error
int32 speed
float64 load
float64 voltage
int32 temperature
bool moving
============Begin Listener.cpp=================
#include "ros/ros.h"
#include "std_msgs/String"
void motorCallback(const std_msgs::String::ConstPtr& msg)
{ ROS_INFO("I heard: [%s]", msg->data.c_str()); }
int main(int argc, char **argv) {
ros::init(argc, argv, "listener");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("motor_states/ttyUSB0", 1000, motorCallback);
ros::spin();
return 0; }