How to create AckermannDriveStamped messages in python
I'm very, very new to ROS and i'm working on my own MIT RACECAR (for those who are unfamiliar http://fast.scripts.mit.edu/racecar/ ). I have a ROS network of nodes and topics to control an ackermann type vehicle platform. There are built in topics that pass along AckermannDriveStamped messages to lower level nodes that do some math/filtering which actually make my car run, and i'm interested in creating my own series of ackermann message and publishing them just to see the car maybe run through a short series of directions autonomously.
I'm wondering how to actually write python code in AckermannDriveStamped format. Here's what I have so far:
import rospy
import yaml
from sensor_msgs.msg import Joy #i'm also trying to play around with Joy messages which is why this import is included
import numpy as np
import std_msgs.msg
import ackermann_msgs.AckermannDriveStamped #this isn't correct, i'm not sure what to import here
header = rospy.Header()
axes = {"axes:[-0.0, -0.0, 0.0, -0.0, -0.0, 0.0, 0.0, 0.0]"}
buttons = {"buttons":"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"}
command = rospy.Header(),axes,buttons
print(header)
print("-------------")
print(buttons)
print("-------------")
print(command)
print("----------------------------")
rospy.loginfo(command)
pub.publish(command)
rate.sleep()
When i runs that ROS spits back :
TypeError: Invalid number of arguments, args should be ['header', 'axes', 'buttons'] args are((seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: '', set(['axes:[-0.0, -0.0, 0.0, -0.0, -0.0, 0.0, 0.0, 0.0]']), {'buttons': '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]'}),)
It's obviously littered with syntax errors and i don't expect to be able to pass an actual array called "buttons", but i did expect there to be some sort of class like rospy.Header than i can use which ROS will understand.
Can anyone provide me some source code for actually creating and publishing AckermannDriveStamped messages or help me out?
PS I'm really sorry about the poor formatting of the code in this question. I couldn't get it to work properly